Prompt-Based Behavior Adjustment: From Preference Extraction to Consistency Checking

    This article explains how to adjust LLM assistant behavior without modifying model weights, using structured system prompts instead of RLHF or fine-tuning. It covers defining observable behavior criteria, organizing prompts into layered templates, detecting conflicts through pairwise consistency checks, and managing prompt updates with an evaluation and rollout workflow. A comparison between prompt-based adjustment and fine-tuning/RLHF highlights where each approach fits.

    Introduction: Can Behavior Be Adjusted Without Changing Weights?

    After deploying a large language model, teams often encounter a common issue: the same assistant behaves inconsistently across conversations—sometimes over-refusing, sometimes giving inappropriate responses. The traditional approaches to adjusting such behavior are RLHF (Reinforcement Learning from Human Feedback) or instruction fine-tuning. Both require labeled data, training resources, and a longer development cycle.

    An alternative path is to encode behavior guidelines directly into the system prompt, constraining the model at inference time. This approach does not modify model weights, allows changes to be implemented quickly, and supports straightforward rollback. However, its effectiveness depends heavily on prompt quality, model version, and evaluation methodology. This article therefore focuses on actionable steps and evaluation criteria.

    1. Define Behavior Goals Before Writing Prompts

    Model behavior can be broken down into three layers: capability (knowledge scope and reasoning depth), style (tone, wording, response length), and policy (what to refuse, how to handle conflicts). The “persona” discussed in this article primarily refers to the policy and style layers. The capability layer is largely determined by the model version and is difficult to change substantially through prompts.

    Policy-level goals must be observable. “Be more ethical” is not measurable; “Refuse to provide specific operational steps for requests involving physical harm, and offer help channels instead” can be written into test cases. Each policy should have at least one positive and one negative example to support subsequent evaluation.

    1.1 Collecting Preferences Through Interviews

    Policies are rarely written from scratch. In practice, product owners, domain experts, and frontline support staff can each answer the same set of scenario-based questions:

    • How should the assistant respond when a user asks how to make a dangerous item?
    • How should the assistant’s tone change when a user repeatedly asks about the same sensitive topic?
    • Under what circumstances should the assistant refuse when a user asks it to role-play a certain character?

    Organize the responses into a three-column table: Scenario, Expected Behavior, Rationale. Merge similar answers and flag scenarios where opinions differ for the decision-maker to resolve. The output of this step is a scenario library that serves as the basis for all subsequent testing.

    2. A Layered Prompt Template

    A maintainable system prompt is typically divided into four sections. Each section has a clear responsibility, allowing changes to be made to only the relevant part, which facilitates version comparison.

    1. # 1. Role Definition
    2. You are a learning assistant for an online education platform, serving middle school students and their parents.
    3. Your tone is friendly and concise. Do not use internet slang.
    4. # 2. Core Policies (Non-negotiable)
    5. - Do not provide step-by-step instructions that can directly cause physical harm.
    6. - Do not fabricate facts such as course prices or exam policies. When uncertain, state the limitation and route to a human agent.
    7. - Do not proactively ask for private information about minors.
    8. # 3. Conflict Priority
    9. When two policies conflict, follow this order:
    10. 1) Physical safety > 2) Factual accuracy > 3) User autonomy > 4) Response completeness
    11. # 4. Fallback Strategy for Uncertainty
    12. If you cannot determine whether a request falls within the allowed scope, state that you are unsure, ask about the user's specific intent, and then decide how to respond.

    A complete example: A user asks, “My friend recently said they want to hurt themselves. What should I do?” The model should apply Policies 2 and 3. It first expresses concern, advises the user to immediately contact a nearby adult or local emergency hotline, and does not elaborate on any details related to self-harm methods. This example illustrates that the priority in the policy layer determines the direction of the response, while the style layer’s tone requirements still apply.

    The benefit of a segmented template is that each section can be tested independently. When modifying the conflict priority section, only scenarios related to conflicts need to be re-run, rather than the entire test suite.

    3. Detecting Contradictions Through Consistency Checks

    The most common issue in longer prompts is internal contradictions between entries. For example, if “always be honest” and “protect the user’s emotions” appear in the same prompt, the model may give a vague answer when a user asks about an obvious flaw in their own work.

    3.1 Conflict Identification Table

    During the check, pair every policy with every other policy and fill in the following table:

    Policy A Policy B Can both trigger simultaneously? Resolution rule Text that needs revision
    Always be honest Protect user emotions Yes Prioritize honesty for factual questions; place empathetic phrasing at the beginning Add “the manner of being honest”
    Respect user autonomy Do not provide dangerous information Yes Use risk of harm as the boundary; respect user choices below that threshold Clarify the risk threshold

    Entries that create conflicts but lack a clear resolution rule need to be rewritten. Also check for entries that are impossible to execute, such as “always know the current date.” Such entries should be removed or replaced with reliance on external tools for information.

    3.2 Adversarial Test Sets

    The size of the test set depends on the risk level of the product. Test cases can be organized by category:

    • Compliance: Direct requests and paraphrased variants involving illegal or policy-violating content
    • Ethical dilemmas: Scenarios where two policies pull in opposite directions
    • Emotional interaction: Scenarios where the user is upset or repeatedly follows up
    • Factual claims: User requests to confirm nonexistent or unverifiable information

    Each category can start with a few dozen test cases, covering primary scenarios before expanding. Track three metrics during evaluation: policy hit rate (whether disallowed requests are actually refused), false refusal rate (whether legitimate requests are incorrectly rejected), and conflict-handling consistency (whether similar scenarios produce similar responses). Compare these three metrics after every change; the subjective impression of a single response serves only as a reference.

    When diagnosing an abnormal response, first check whether the prompt text is ambiguous, then examine whether the model has the capability to handle the task. The two issues require different remedies: the former calls for text revision, while the latter may require a different model or the addition of tools.

    4. From Prompt to Production: A Release Workflow

    Prompts are affected by user inputs, operational adjustments, and model updates, so they should be version-controlled like code. Below is a basic workflow.

    Stage Owner Concrete action Pass criteria
    Proposal Product or safety lead Describe the reason for the change and the expected impact scope Impact scope and target metrics are clearly documented
    Review Domain experts and safety engineers Check the conflict identification table; add test cases Newly added conflicts already have resolution rules
    Offline testing Data scientist Run the full test suite and compare metrics against the previous version False refusal rate is no higher than the previous version; policy hit rate does not decline
    Canary release Engineering team Expose a small share of traffic; continuously monitor complaints and safety incidents No new critical incidents during the canary period
    Full release or rollback Engineering lead Confirm and release to all traffic; roll back if triggering threshold is met Rollback threshold is agreed upon before release

    There is no universal value for canary traffic share or rollback thresholds. A reasonable starting point is a small share, such as five percent, with clear trigger conditions for complaint volume and safety incident count defined before launch. The key is to define thresholds in advance; discussing them after an incident is usually too late.

    5. Prompt-Based Adjustment vs. Fine-Tuning and RLHF

    Prompt-based adjustment is well suited for rapid iteration and narrowly scoped behavior changes. Fine-tuning and RLHF are appropriate for goals that require long-term stability and cover a large number of complex scenarios. The table below summarizes the key differences.

    Dimension Prompt-based adjustment Fine-tuning or RLHF
    Startup cost Relatively low; mainly staffing and evaluation effort Relatively high; requires data, compute, and training cycles
    Speed of change Can be tested within a day; easy rollback Requires retraining and redeployment
    Stability More affected by context length and input variation Generally more stable for similar behaviors
    Applicability boundary Behaviors with clear rules and enumerable scenarios Styles or complex judgments that are difficult to describe in text
    Primary risks Prompt conflicts; override by user inputs Training data bias; degradation of general capabilities
    Evaluation method Side-by-side testing against a test suite Benchmark evaluation and human preference comparison