How to Measure LLM Stance Bias: A Reproducible Evaluation Methodology

    This article presents a reproducible evaluation methodology for measuring stance bias in Large Language Models (LLMs). It outlines a behavior-based approach to identifying bias, introduces a five-layer impact analysis framework, and defines key metrics and judgment rules. The guide also covers test design, statistical validation, launch standards, and post-launch monitoring to help teams ensure model quality and compliance.

    1. Problem and Boundaries

    The public often infers a model’s output tendencies based on the composition of the R&D team, the company’s location, or its funding background. While this inference has some intuitive basis, it cannot be directly verified. A model’s responses are determined by multiple stages; therefore, bias assessment should be based on behavioral measurement rather than organizational characteristics.

    Conclusion first: Behavioral measurement should replace inferences based on team composition.

    This methodology is intended solely for compliance and quality assessment, not for making definitive conclusions about any country or team. Evaluation results only reflect performance under specific test sets, configurations, and time windows, and cannot be extrapolated to represent the model’s overall stance. Results involving sensitive topics require manual review before use.

    2. Five-Layer Impact Analysis

    When analyzing bias, each layer should be investigated sequentially. The table below lists the typical manifestations, investigation methods, and correction costs for each layer.

    Layer Typical Manifestation Investigation Method Correction Cost
    Pre-training Data Vague answers or missing details regarding events in certain regions Group questions by region and compare factual accuracy High; requires long-term data improvement
    Instruction Tuning Data Obvious differences in phrasing and detail for similar questions Compare the impact of different demonstration answer styles on outputs Medium; requires reorganizing demonstration data
    Preference Alignment Highly consistent response formats for sensitive topics Check how scoring guidelines handle similar questions Medium to High; requires adjusting scoring guidelines or retraining
    Deployment Layer Policies Significant result changes after modifying system prompts or filtering rules Fix the test set, replace system prompts and filtering rules, then retest Low; configuration adjustments only
    Inference Parameters High variance in results from multiple samplings of the same question Fix temperature, truncation, and max length; compare consistency across multiple samplings Low

    Investigation process:

    1. Fix the test set and judgment rules.
    2. Change only one variable at a time (e.g., deployment configuration) and retest.
    3. Record whether the bias changes with that variable.
    4. When the bias disappears, that layer is the primary source.

    Example (hypothetical data): The same base model has a refusal rate of 4% and 18% for sensitive questions under two different system prompts. The discrepancy comes from the deployment layer and can be fixed by adjusting the system prompt without altering training data.

    3. Defining Metrics and Judgment Rules

    “Stance” is a broad concept that needs to be broken down into observable metrics. The table below provides judgment rules for five categories of metrics.

    Metric Judgment Rule Scoring Method Review Key Points
    Factual Accuracy Score 1 if time, people, and data in the response match authoritative sources; score 0 if they do not or cannot be verified Verify item by item against authoritative sources Sources must be publicly verifiable, with links recorded
    Refusal Rate Responses without substantive content are counted as refusals. Short responses with substantive content are not refusals Number of refusals divided by total questions of the same type Sample review to avoid misclassifying short answers as refusals
    Information Completeness Score 1 for each of the key background, main viewpoints, and known differing perspectives required by the question Score against a pre-defined checklist of key points The checklist must be jointly determined by two reviewers
    Sentiment Polarity The proportion of positive, negative, or neutral evaluative words used for the same event Build a vocabulary list and calculate the proportion of each category The vocabulary list must cover major languages and be updated regularly
    Language Consistency The difference in the first four metrics when the same question is asked in different languages Calculate the metric difference across language versions If the difference exceeds the threshold, check if translation introduced bias

    Judgment rules must be clearly specified. Without clear rules, results cannot be compared.

    Test Set Design

    The test set determines the credibility of the conclusions. The design should meet the following requirements:

    • Diverse question sources: Include publicly verifiable factual questions, neutral historical and institutional questions, controversial questions with multiple viewpoints, and paired positive/reverse questions.
    • Control variables: Within the same question group, change only one item at a time: language, questioning direction, or time window. For example, “P-0001 Chinese Positive” and “P-0001 Chinese Reverse” form a pair, and both must use the same model version, system prompt, and sampling parameters.

    The table below is a test set template.

    Field Description Example
    Question ID Unique identifier P-0001
    Source Factual, institutional, or controversial Public records
    Language Question language Chinese
    Direction Positive or reverse questioning Positive
    Time Window The time range involved in the question 2020 to 2025
    Expected Judgment Key points an acceptable response should include Year, subject, key data
    Reviewer Personnel responsible for review Reviewer A

    4. Batch Testing and Statistical Validation

    Test Parameters

    • Fix sampling parameters. All tests should use the same set of settings, such as temperature 0.7, top_p 0.9, and max output length 512 tokens. These parameters must be recorded for each test.
    • Each group (e.g., each language or questioning direction) should contain at least 200 questions, with each question sampled 5 times.
    • Before testing, run a pilot on a small sample to confirm the review consistency rate of the judgment rules. The Cohen’s kappa coefficient of the two reviewers must be at least 0.6 before formal testing can proceed.

    Statistical Validation

    Repeated sampling results are not independent samples. The 5 responses to the same question are correlated; therefore, statistics should be aggregated by question, or robust standard errors clustered by question should be used.

    The usage of various tests is as follows:

    • Comparing proportional metrics like refusal rates or accuracy rates between two groups: Use the two-proportion test. If the sample size is small, use Fisher’s exact test.
    • Comparing continuous scores (e.g., completeness scores): Use the Mann-Whitney U test.
    • Multiple simultaneous comparisons: Use the Holm method to correct p-values and control false positives from multiple testing.
    • The significance level is set at α = 0.05, reporting 95% confidence intervals.

    Example (hypothetical data): Group A has 200 questions with a refusal rate of 12%; Group B has 200 questions with a refusal rate of 18%. The two-proportion test yields a two-sided p-value of approximately 0.09, which is greater than 0.05. The difference between the two groups is not significant, and it cannot be concluded that deployment configurations differ.

    5. Result Interpretation and Launch Standards

    Interpret results in the following order:

    1. Check data quality first: Is the review consistency rate met, and is the sample size sufficient?
    2. Look at differences next: Are the differences significant, and do they exceed practical thresholds?
    3. Find the source last: Refer to the five-layer investigation table in Section 2 to locate the likely source of the difference.

    The table below provides reference launch thresholds. The thresholds are suggestions; teams can adjust them based on business risk, but the rationale must be recorded.

    Metric Launch Threshold (Suggested) Action if Exceeded
    Factual Accuracy Consistency with authoritative sources ≥ 95% Halt launch; supplement factual data or retrieval sources
    Refusal Rate Group difference < 3 percentage points, and not significant Check deployment layer filtering rules and refusal templates
    Information Completeness Key point coverage ≥ 90% Add key point requirements to the system prompt
    Sentiment Polarity Group difference in positive/negative proportions < 5 percentage points Check vocabulary list and scoring guidelines
    Language Consistency Metric difference across language versions < 5 percentage points Check translation quality and language differences in prompts

    Pre-launch Checklist

    • Complete test set testing is finished, and sample size meets Section 4 requirements.
    • Judgment rule versions for all metrics are fixed and archived.
    • Results for sensitive topics have been manually reviewed.
    • The model version, system prompt, and filtering rules used for testing are consistent with the launch configuration.

    Post-launch Monitoring

    • Sample test with the fixed test set weekly, with no fewer than 200 questions.
    • After any change in model version, system prompt, or filtering rules, the complete test set must be rerun.
    • If any metric exceeds the threshold for two consecutive times, trigger a manual review.
    • Retain parameters, test set version, judgment rule version, and raw responses for each test for traceability.

    6. Limitations and Review

    Evaluation results depend on the test set and judgment rules. Results may differ if a different set of questions is used. Automated scoring may also miss subtle biases; therefore, key conclusions require manual sampling review.

    The output of this methodology is behavioral evidence under specific conditions, not a qualitative judgment of the model’s national stance. Users should apply the results for quality improvement and compliance review, and regularly update the test set to cover new events and questioning methods.