Overview

1 Evaluations and alignments for AI

Evaluation and alignment are presented as the two core mechanisms for making AI systems useful, safe, and dependable in practice. Evaluation asks what a model or system actually does, while alignment asks what it should do, and together they form a feedback loop that guides development from early model versions to full production systems. The chapter emphasizes that success in AI engineering depends on measuring behavior carefully, identifying gaps, and then applying corrections that bring the system closer to intended goals.

The text explains that evaluating LLMs is harder than testing traditional software because their outputs are open-ended, probabilistic, and often subjective. To organize this complexity, it distinguishes verifiable tasks, where correctness can be checked objectively, from open-ended tasks, where multiple answers may be valid and judgment depends on context. It then surveys evaluation methods across this spectrum, including reference-based metrics that compare outputs to gold answers, reference-free methods that judge intrinsic quality, human evaluation, and LLM-as-a-judge approaches, while also highlighting practical issues such as answer extraction, verifier reliability, test coverage gaps, and hallucination detection.

On the alignment side, the chapter identifies three pillars: principled alignment, which embeds values like helpfulness and harmlessness; policy-based alignment, which enforces concrete rules and instruction hierarchies; and personality alignment, which shapes tone, style, and character consistency. It concludes by framing AI engineering as an iterative cycle of defining success, evaluating, analyzing errors, and aligning the system again, with evaluation treated as the reward signal that drives improvement. The overall message is to work backward from desired outcomes, use evidence rather than intuition, and build evaluation infrastructures that can reliably support production-ready AI systems.

A taxonomy of AI evaluation methods, distinguishing between verifiable tasks and open-ended tasks.
AI’s answer is correct but requires parsing. The model produces a chain-of-thought (COT) response where the final answer must be extracted from the surrounding text.
Open-ended evaluation tasks require navigating a landscape of subjective quality judgements and are broadly classified into Reference-based and reference-free evaluations.
Reference-based evaluation workflow. Human experts create reference answers from a test set. The AI system generates candidate responses from the same inputs. The evaluator then compares each candidate's response with the corresponding reference response, producing scores.
Reference-free evaluation workflow. Quality signals are defined for the task. The AI generates outputs for test inputs. Metrics assess each output’s intrinsic properties without reference answers. Scores reveal quality patterns and failure modes.
Example task evaluation instructions provided to Amazon Mechanical Turk data labeler.
Training progression showing how models learn format before knowledge. Source: “Characterizing Learning Curves During Language Model Pre-Training: Learning, Forgetting, and Stability” by Chang et al, 2023.
Example of hallucinated authorship in an AI response.
Three pillars of alignment and how they relate to each other.
The iterative cycle of AI engineering. Define establishes what success looks like, Evaluate measures the current system against the designed evaluation metrics, Error analysis identifies failure modes, and then Align optimizes the system using different methods. The cycle then repeats.

Summary

  • Evaluation measures whether a model, agent, or AI system performs the intended task accurately, reliably, and across edge cases. Alignment ensures the model’s behavior matches human goals, intentions, and values. Together, they ensure AI systems follow user intent and complete tasks safely.
  • AI systems span a spectrum from verifiable to open-ended tasks.
    • Verifiable tasks have objectively checkable outputs—coding and math are common examples.
    • Open-ended tasks lack objective verification; examples include translation, report generation, and creative writing.
  • There are two broad approaches to evaluating open-ended tasks, both aiming to approximate human judgment as closely as possible.
    • Reference-based evaluations compare model outputs to expert-produced gold standards.
    • Reference-free evaluations rely on intrinsic properties of generated content, sometimes guided by expert criteria.
  • Evaluations may use heuristic, statistical, semantic, or LLM-as-a-Judge methods to align with human evaluators, even though humans often disagree.
  • Hallucinations occur because AI systems learn structure and form before learning factual grounding—they master how to sound correct before knowing what is correct. Hallucination can be measured using faithfulness metrics.
  • The three pillars of alignment are principled, policy-based, and personality-based.
    • Principled alignment aligns AI with foundational human values.
    • Policy-based alignment aligns AI behavior with specific rules, norms, or institutional policies.
    • Personality-based alignment shapes consistent traits and communication styles in AI behavior.
  • Evaluation and alignment are interdependent. Evaluation metrics become optimization targets, creating feedback loops that can lead to emergent or unintended behaviors.
  • Working backward from desired outcomes distinguishes AI engineering from research and other forms of engineering — we define metrics first, then build systems to optimize them.
  • There is no one-size-fits-all solution. Every evaluation and alignment technique involves trade-offs that must be carefully balanced for specific use cases.

FAQ

What is the difference between AI evaluation and alignment?Evaluation asks what a model or system actually does, while alignment asks what it should do. Evaluation measures performance, reliability, and behavior; alignment aims to make the system follow human goals, policies, and values.
Why are LLMs harder to evaluate than traditional software or classical ML models?LLMs produce free-form text instead of deterministic outputs or fixed class labels. The same prompt can have many valid answers, and qualities like helpfulness, tone, and coherence are subjective, which makes unit tests and simple accuracy metrics insufficient.
What are verifiable tasks in AI evaluation?Verifiable tasks are tasks with objectively correct answers that can be checked automatically. They are convergent, meaning correct solutions lead to the same result, such as math problems, code that passes unit tests, or classification tasks with predefined labels.
What are open-ended tasks, and why do they need different evaluation methods?Open-ended tasks allow multiple valid responses and often depend on context, preference, or judgment. Since there is usually no single correct answer, they require reference-based or reference-free evaluation methods instead of purely automated correctness checks.
What is reference-based evaluation?Reference-based evaluation compares a model’s output to a human-created or human-verified “golden” answer. It is commonly used in translation and summarization, and it includes metrics such as BLEU, ROUGE, and BERTScore.
What is reference-free evaluation?Reference-free evaluation judges output quality without comparing it to a gold standard. It looks at intrinsic qualities such as relevance, coherence, faithfulness, readability, or task-specific properties, and can use human evaluators or LLM-as-a-Judge systems.
Why is hallucination such an important evaluation problem?Hallucination happens when a model generates confident but unsupported or fabricated information. It is especially dangerous because the output may sound plausible, which can mislead users and cause serious real-world harm.
What are the three pillars of alignment?The three pillars are principled alignment, policy-based alignment, and personality alignment. Principled alignment focuses on values and safety, policy-based alignment focuses on rules and procedures, and personality alignment shapes tone, style, and character consistency.
What does the iterative evaluation-alignment cycle look like in practice?You define success metrics, measure the current system, analyze failures, and then apply alignment changes such as prompt updates, retrieval improvements, or model tuning. After that, you evaluate again and repeat the cycle continuously.
Why does the book emphasize working backwards from desired outcomes?Because in AI engineering, you should define what success looks like before building the system. If you cannot measure a behavior, you cannot reliably optimize it, and the evaluation framework becomes the design constraint that guides development.

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • LLM Evaluation and Alignment, The Foundational Ideas ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • LLM Evaluation and Alignment, The Foundational Ideas ebook for free