Where Do LLM Biases Come From? Alignment and Evaluation Explained

    This article explains why large language models show group-level tendencies when prompts change only slightly in language, script, or regional cues. It traces the causes to corpus distribution and sampling bias, annotation guidelines, alignment trade-offs, and evaluation that lacks a group dimension. Developers will find reproducible measurement ideas, a practical governance workflow, and code and configuration examples for layered evaluation, red-teaming, and post-generation checks.

    1. The Symptom: Why Model Outputs Show Group-Level Tendencies

    In real deployments, developers often run into a specific class of problem: change only the language, character set, or a few region-related cues in the same prompt, and the model’s answer quality, refusal rate, and wording tendencies shift noticeably. This is not an isolated defect. It is the combined result of data, training objectives, and evaluation criteria. Treating it as “a model taking a side” misses the actual engineering levers.

    The right way to frame the issue is as “uneven output distribution” and “group-level bias,” not as an assessment of any single vendor or product. For developers, the useful outputs are reproducible measurement methods, an executable governance process, and a general set of capabilities for running that process on a cloud platform.

    2. Cause 1: Corpus Distribution and Sampling Bias

    Pretraining corpora are naturally unbalanced across regions and languages. High-resource languages and content from specific regions make up a larger share, so the model has denser facts, more idiomatic expression, and broader common-sense coverage there. For low-resource languages and niche groups, the corpus is thin, and the model tends to fill the gaps with patterns from high-resource regions, which produces stereotyped phrasing.

    1. # Example: measure language/region coverage in the corpus
    2. from collections import Counter
    3. def coverage_report(samples):
    4. c = Counter(s["locale"] for s in samples)
    5. total = sum(c.values())
    6. return {k: round(v / total, 4) for k, v in c.most_common()}

    The engineering recommendation is to build a coverage dashboard at data ingestion time, run targeted collection and deduplication for sparse shards, and avoid letting duplicate samples amplify existing tendencies.

    3. Cause 2: Annotation Guidelines and Subjective Judgment

    Annotating preference data inevitably carries the annotators’ cultural background. When the guidelines lack clear boundaries for describing sensitive groups, annotators fill in the gaps with their own experience, and regional consensus ends up written into the model’s preferences. The vaguer the guidelines, the more easily the model learns an implicit policy of “being stricter toward a certain kind of subject.”

    The fix is to break the guidelines down into decidable items: what counts as a factual statement, what counts as group attribution, and what must be refused or restated from an authoritative source. Add cross-review by annotators from different backgrounds, and log the samples where they disagree for later auditing.

    4. Cause 3: Trade-offs in Alignment Objectives

    Safety alignment usually requires a trade-off between helpfulness and harmlessness. When the policy applies a more conservative blocking threshold to a certain class of keywords, requests containing the related character sets get over-blocked, which becomes de facto differential treatment. This is not a matter of intent; it is a side effect of the threshold and recall strategy.

    1. request -> language/script detection -> risk tiering -> threshold decision -> answer or refusal
    2. ^
    3. without per-language calibration, the error is amplified

    A workable approach is to calibrate thresholds separately by language and scenario, track two metrics, over-refusal rate and miss rate, and keep regressing against an offline replay set so that tuning for one scenario does not introduce new bias in another.

    5. Cause 4: Evaluation Without a Group Dimension

    Most evaluations report only overall accuracy, which hides shard-level differences. To surface the problem, the evaluation set must be stratified by language, regional cues, and task type, and you must report worst-slice performance rather than the average. Stratified evaluation is the prerequisite for every governance action that follows.

    6. A Governance Process You Can Actually Run

    1. Build a stratified evaluation set and a fixed replay set, and run a full regression on any change to prompts, retrieval strategy, or thresholds.
    2. Put red-team cases in place covering variants such as language switching, character substitution, and indirect reference, and measure differences in refusals and tendencies.
    3. Add post-generation validation on the inference side to run a second decision and rewrite on group-attribution statements.
    4. Wire logs, metrics, and alerts into general-purpose cloud logging and monitoring/alerting capabilities to create a traceable chain.
    1. {
    2. "slice": {"lang": "zh", "task": "qa"},
    3. "metrics": {"accuracy": 0.0, "over_refusal": 0.0, "bias_gap": 0.0},
    4. "gate": "bias_gap <= 0.05"
    5. }

    7. Conclusion

    The group-level tendencies a model displays are the stacked result of data distribution, annotation guidelines, alignment thresholds, and evaluation criteria, and they can be measured and reduced with engineering means. Using general-purpose capabilities from Baidu AI Cloud for data storage, containerized deployment, and log monitoring, teams can turn stratified evaluation, red-team regression, and post-generation validation into a continuous process, keeping intelligent applications stable and compliant across multilingual and multi-region scenarios.