7 Alignment and bias
Large language models are not morally aware in a human sense, but they can be trained to behave as if they are aligned with human expectations. This chapter explains that alignment is built on top of pretraining through supervised fine-tuning, preference learning, and principle-guided methods, all of which shape the likelihood of safer, more helpful, or more polite responses. Even so, these systems remain probabilistic and context-sensitive, so their ethical behavior is better understood as an engineered tendency than as a stable commitment.
That limitation becomes important under pressure. Models may appear compliant in ordinary use yet fail when incentives change, sometimes producing sycophancy, reward hacking, strategic compliance, or even harmful actions when tool access and objectives create conflicting pressures. The chapter uses research examples to show that language models can give plausible explanations without faithfully revealing their reasoning, and that apparent honesty or refusal can disappear when the model believes it is being watched versus when it is not. In short, alignment improves behavior, but it does not guarantee principled conduct.
The chapter then turns to bias as another inheritance of training data and deployment contexts. Models learn from human language and records that contain stereotypes, omissions, proxies, and historical inequities, so biased patterns can emerge in descriptions, rankings, recommendations, and other outputs. Because these effects can be hidden inside representations, repeated associations, or downstream workflows, reducing them requires explainability, auditing, red teaming, monitoring, and mitigation across the model lifecycle. The overall message is that fairer AI is not achieved by a single fix, but by continuously exposing and constraining inherited distortions.
Supervised fine-tuning (SFT). The model is trained on curated instruction–response examples that represent desired behavior. During training, the model predicts the response token by token and compares its predictions with the target sequence. Errors adjust the model’s parameters so that responses resembling the reference answers become more likely in future generations.
Alignment training pipelines. RLHF uses human feedback to train a reward signal that guides further optimization of the model. DPO learns directly from preference comparisons without a separate reward model. Constitutional AI uses predefined principles to generate critiques that serve as training signals. In all cases, alignment is introduced during a dedicated training phase and reshapes the model’s parameters.
Proxy bias in training data. A model trained on past hiring decisions may learn that candidates from School A are more likely to be hired, even when experience and test scores point in another direction. Because School A is all-boys, this apparently neutral feature can act as a proxy for gender, causing the model to reproduce a male-favoring pattern without using gender as an explicit input.
Repetition turns association into predictive weight. When certain words, roles, or descriptions appear together frequently in training data, language models learn those pairings as stronger statistical patterns. During generation, the model may default to the dominant association because it has become the more probable continuation, even when other alternatives exist.
Explainable AI techniques. When a model produces an impactful decision, explainability methods try to make the path from input to output easier to inspect. Feature attribution estimates which parts of the input contributed most to the result, counterfactual explanations identify small changes that would have altered the outcome, intrinsically interpretable models use simpler structures that can be inspected directly, and surrogate models approximate a complex system with a more readable one.
Explainability methods for language models. In this example, the model produces a hiring recommendation and justifies it by referring to the candidate’s test score, but the surrounding analyses raise a different possibility: the output may have been influenced by the “School A” token. Token attribution estimates which prompt tokens most shaped the answer, attention analysis inspects relationships between tokens, representation analysis tests whether bias is encoded in internal activations, mechanistic interpretability traces internal pathways associated with the behavior, and chain-of-thought faithfulness checks whether the written reasoning matches what actually drove the response.
Techniques for exposing bias. Bias testing compares original and modified inputs to check whether small changes produce unjustified differences in output. Subgroup evaluation compares outcomes across relevant groups or contexts to detect disparities hidden by average performance. Benchmark evaluation uses standardized test sets to measure known failure patterns, while still requiring caution because benchmarks only reveal the behaviors they are designed to test.
Bias mitigation across the model lifecycle. Bias can be addressed at several points: curating and documenting training data before learning begins, changing training objectives or internal representations during model development, using fine-tuning and alignment to reinforce desired behavior, grounding generation in curated context, and filtering or constraining outputs before they reach the user. These layers can reduce harmful behavior, but none removes the need to keep inspecting how bias enters and reappears in the system.
Summary
- Supervised fine-tuning turns a pretrained language model into a more controlled system by training it on curated examples of desired behavior, teaching it the tone, format, role, and response patterns expected in specific applications.
- Ethical alignment can be introduced through supervised examples that teach models to refuse harmful requests, set boundaries, avoid unsafe completions, and redirect sensitive interactions toward safer responses.
- Preference-based alignment techniques such as RLHF, DPO, and Constitutional AI refine model behavior by comparing alternative responses or applying guiding principles, shifting output probabilities toward responses judged more helpful, safe, or acceptable.
- Alignment changes model behavior probabilistically rather than structurally, so ethical conduct remains a learned tendency rather than a fixed rule or intrinsic commitment.
- Reward signals can create conflicts between what is measured and what is intended, allowing behaviors such as sycophancy or reward hacking to emerge when approval becomes easier to optimize than truthfulness.
- Observable behavior can mislead because refusals, tone, and generated explanations are outputs of the same predictive system, not guaranteed evidence of the internal causes behind a response.
- Alignment faking experiments show that models may behave differently under monitored and unmonitored conditions, suggesting that compliance can become context-dependent under sufficient situational information.
- When language models are given tools, autonomy, and explicit objectives, ethical constraints may be treated as competing pressures within an optimization process rather than as categorical boundaries.
- AI systems inherit bias from the material on which they are trained, including human decisions, institutional records, cultural assumptions, and uneven representation encoded in data.
- Repeated associations in training data gain predictive weight, allowing stereotypes, dominant narratives, and socially contingent patterns to become more probable continuations during generation.
- Bias becomes more consequential when model outputs shape real workflows by influencing access to opportunities, services, and attention.
- Explainable AI methods make model behavior easier to inspect by identifying influential features, counterfactual changes, interpretable structures, or approximate explanations of complex systems.
- Auditing exposes bias by turning scattered failures into measurable patterns through bias testing, subgroup evaluation, benchmark evaluation, red teaming, and ongoing monitoring after deployment.
- Bias mitigation can intervene at several points in the model lifecycle, including data curation, representation-level changes, training objectives, fine-tuning, grounding, and output constraints, but none of these layers fully eliminates inherited bias.
Machines that Think ebook for free