Text annotation for LLMs : instruction tuning, RLHF and preferences

The large language models powering today’s conversational AI assistants, code generation tools and AI agents all go through the same multi-phase training sequence. Pre-training on massive text corpora gives them broad linguistic competence: they learn to predict the most plausible continuation of a token sequence, which enables them to generate coherent text at scale. But what makes them genuinely useful, safe and aligned with human expectations happens in a distinct subsequent phase called post-training, a process that relies entirely on text annotation produced by human experts. This text annotation bears little resemblance to classical NLP labeling tasks such as named entity recognition or document classification: it requires annotators to judge responses, compare alternatives, rewrite outputs and, in some cases, deliberately craft adversarial prompts to expose the model’s failure modes before deployment.

Three main methods structure the production of post-training data today: instruction tuning, RLHF (Reinforcement Learning from Human Feedback) and its algorithmic variants such as DPO (Direct Preference Optimization), and red teaming. Each method mobilizes text annotation in a different form, with specific requirements in terms of annotator profiles, guidelines and quality control processes. This article describes the mechanics of each method, the concrete tasks they impose on annotators, and the criteria that distinguish a post-training dataset that genuinely improves a model from one that pushes it in an unintended direction.

Text annotation at the heart of the LLM post-training cycle

An LLM does not emerge from pre-training in an aligned state. It can complete text in a plausible manner, but without further guidance it may produce dangerous instructions, incoherent answers, offensive content or responses that are simply unhelpful in a given context. Post-training is the sequence of work that addresses these limitations, using human-annotated data to shift the model’s output distribution toward responses that are helpful, accurate and safe. This sequence generally involves two main phases: first, supervised fine-tuning (SFT), also called instruction tuning, which teaches the model the expected format of a productive interaction; then preference-based alignment, which teaches it to distinguish between better and worse responses according to explicitly defined human criteria.

Text annotation plays a role at every stage of this sequence. For SFT, annotators write or validate instruction-response pairs that serve as reference examples. For preference alignment, they compare and rank responses generated by the model. For red teaming, they construct adversarial prompts designed to reveal system vulnerabilities before they can be exploited in production. Teams specializing in text annotation for NLP and LLMs have become a critical link in the AI model value chain, extending well beyond classical natural language processing tasks. For an overview of text annotation tasks across the full NLP spectrum, see our complete guide to text annotation for NLP, which covers the full range from NER to LLM post-training data.

Instruction tuning: text annotation for behavioral alignment

Instruction tuning is the first phase of post-training. Its goal is to teach the model to follow instructions reliably: answering open-ended questions, reformatting text to match a given style, extracting structured information from a document, explaining a concept at different levels of technical depth. The primary material for this phase is a dataset of instruction-response pairs, where each example shows the model what “responding well” means for a given type of request. The quality and diversity of this dataset directly affect the model’s general behavior after fine-tuning: a dataset that is too homogeneous produces a model that performs well on common cases but fails on atypical ones.

Text annotation for instruction tuning takes several forms depending on the project’s maturity. In early phases, annotators write instructions representative of the target use cases, along with a reference response they consider exemplary. In later phases, the model generates candidate responses that annotators validate, correct or reject according to explicitly defined criteria. The annotator’s role is no longer to respond on behalf of the model, but to pass an informed judgment on the quality of its output across specific dimensions: factual accuracy, adherence to the instruction, appropriate length, tone suited to the context, and absence of problematic content.

Concrete annotation tasks in instruction tuning

An instruction tuning project mobilizes several types of text annotation tasks. Writing diverse prompts is often the first: annotators are asked to produce instructions covering a wide variety of formulations, registers, lengths and levels of complexity. Diversity is not incidental: two different formulations of the same request can lead the model to significantly different post-fine-tuning behaviors. A dataset rich in reformulations and contextual variations produces more robust models than one where each task type is represented by only a handful of stereotyped examples. Response validation is the direct counterpart to prompt writing: for each instruction, the annotator verifies that the reference response is correct on substance, well-formulated in style, and contains no content that would violate the usage policies defined for the project.

Response correction is a third frequent modality in text annotation projects for instruction tuning. The model produces an imperfect response; the annotator identifies precisely what is wrong (factual error, mismatched tone, partially ignored instruction, excessive length, off-topic digression) and rewrites the response to correct it. This rewriting is a demanding task because it requires the annotator to understand both what the model attempted to do and what it should have done, preserving the correct parts while correcting the deficient ones. An annotator who completely rewrites a response that was 80% correct creates a less precise training signal than one who precisely targets the passages in need of correction.

The structure of a well-constructed instruction-response pair

A high-quality instruction-response pair for SFT is not simply a question with its correct answer. It must be representative of a clearly delimited task type, sufficiently distinct from other examples in the dataset to avoid creating learning shortcuts, and aligned with the values the model is meant to embody: honesty, helpfulness calibrated to the complexity of the request, and explicit refusal of requests that violate usage policies. Teams producing these datasets define task taxonomies and quality criteria for each category before annotation begins. This upfront methodical structuring prevents unbalanced datasets where some instruction types are overrepresented and others absent, producing a model that performs well on covered cases and fails on everything else.

Traceability of each pair is an integral part of the rigor expected in this type of project: unique identifiers, creation dates, annotator profiles, version of applied guidelines, quality control results. These metadata are essential during audits, during guideline iterations (frequent in the first weeks of any LLM project) and for any regulatory compliance approach related to training data, particularly under the EU AI Act.

RLHF: text annotation as a human preference signal

RLHF is the method that has enabled conversational AI assistants to reach their current level of perceived usefulness. Its principle is to have humans evaluate not a response as correct or incorrect in absolute terms, but a preference between two responses generated by the model. The annotator chooses which of the two they prefer according to a set of criteria defined in the guidelines. These preferences train a separate reward model that learns to predict human preferences in any given situation; the LLM is then optimized to maximize this reward signal via reinforcement learning algorithms. DPO uses the same human preference data but simplifies the pipeline by eliminating the intermediate reward model.

In all cases, the base material remains the same: pairs of responses compared by a human annotator, with an indication of which is preferred and, depending on the guidelines, a written justification. Text annotation for RLHF is fundamentally a comparative judgment task. It is structurally more difficult than classical annotation because it involves multiple criteria that are sometimes in tension, and a level of nuance that few annotation interfaces capture fully. This is why guideline quality is especially critical in these projects: a poorly briefed annotator will tend to use implicit heuristics that introduce systematic biases that are difficult to detect after the fact.

Annotating preferences: what RLHF annotators actually do

When an annotator compares two responses in an RLHF project, they are not simply choosing which is “better written.” They simultaneously evaluate multiple dimensions: Is the response factual and verifiable? Does it precisely address what was asked, without omitting essential elements or expanding on unsolicited points? Is it clear, well-structured, and appropriately register-matched to the request? Does it contain dangerous claims, stereotypes, incorrect information, or internal inconsistencies? Is its length proportional to the complexity of the question? Each of these dimensions can point in different directions depending on the two responses being compared. One response may be impeccably written but contain a factual error. Another may be stylistically awkward but more honest about the limits of its knowledge. The annotator must arbitrate between these tensions according to a pre-established hierarchy of criteria.

The quality of this arbitration depends directly on the guidelines provided. Effective RLHF guidelines explicitly define the hierarchy of preference criteria: safety takes precedence over immediate helpfulness, honesty over flattery, accuracy over comprehensiveness. They include documented edge-case examples and explained arbitration decisions, so annotators do not need to reconstruct this hierarchy from intuition. Without this rigor, annotators tend to favor longer or more fluent responses at the expense of actual relevance. This length bias is one of the most consistently documented phenomena in RLHF dataset literature, and it propagates into model behavior as excessive verbosity.

Biases that undermine preference annotation

Several systematic biases have been identified in preference datasets for RLHF. The length bias leads annotators to prefer longer responses regardless of their actual relevance. Position bias favors the first response presented in the interface when both options are of comparable quality. Confidence bias leads annotators to overweight responses that appear assured, even when they assert things inaccurately. Cultural bias means that annotators from the same socio-cultural or linguistic background share systematic preferences that are not universally representative. Detecting and correcting these biases requires regular annotator calibration on reference examples, periodic recalibration sessions, and ongoing tracking of inter-annotator divergences to identify drift before it contaminates the entire dataset.

Multi-turn conversational data: specific requirements for text annotation

Modern AI assistants do not operate in single-turn question-and-answer mode: they maintain conversations across multiple exchanges, preserving memory of context, incorporating preferences expressed earlier in the dialogue, and progressively adapting their tone and level of detail as the conversation evolves. Preparing models for this behavior requires multi-turn conversational data, which represents a particularly complex form of text annotation whose requirements go well beyond those of a simple instruction-response pair.

In a multi-turn dataset, an annotator cannot evaluate a single exchange independently of those that precede it. They must read the entire conversation, verify that the model maintains contextual consistency over time: it does not pretend to forget what the user clarified two messages earlier, that the language register adapts correctly to signals sent by the user, and that corrections or clarifications provided by the user during the conversation are properly integrated into subsequent responses. A model that loses track of context in a long conversation is perceived as unreliable, even if each of its individual responses appears satisfactory when read in isolation. The time-per-example cost of this type of project is significantly higher, and guidelines must anticipate the numerous edge cases that emerge in extended exchanges.

The very definition of conversational turns may itself be the subject of preparatory text annotation work: segmenting raw dialogue data into coherent turns, identifying thematic shifts within the same conversation, marking register changes or transitions between topics. These dialogue structuring tasks serve to train specific model components, such as contextual memory management, topic shift detection, or stylistic consistency maintenance across the duration of an exchange.

Red teaming: adversarial text annotation for LLM safety

Red teaming refers to the set of activities aimed at identifying an AI system’s vulnerabilities before production deployment, by deliberately adopting the posture of a malicious user or adversary. Applied to LLMs, it consists of building prompts designed to push the model off its guardrails: causing it to produce prohibited content, revealing information it should not disclose, being manipulated through fictional scenarios, or adopting a persona that contradicts its core values. The results of these tests serve two distinct purposes: directly correcting identified problematic behaviors, and building an adversarial text annotation dataset used to train the model to resist the same attack types in the future. Red teaming is therefore both a testing activity and a data production activity.

Types of vulnerabilities targeted by red teaming

Red teamers work across several categories of vulnerabilities, each requiring a specific approach and expertise. Jailbreaks attempt to bypass the model’s guardrails by reformulating a prohibited request indirectly, embedding it in a fictional or roleplay scenario, or using chains of prompts that gradually lead the model toward behavior it would have refused if requested directly. Hallucination testing verifies that the model does not fabricate plausible but inaccurate information when its knowledge is limited: an LLM that invents bibliographic references, statistics or legal rulings is a significant liability in professional contexts. Bias testing examines whether the model produces systematically different responses depending on the gender, nationality, religious affiliation or political identity implicitly present in the prompt. Data leakage testing verifies that no content memorized during pre-training is extractable through clever prompting.

Every adversarial prompt produced during these tests, whether it successfully deceived the model or not, is itself an instance of text annotation in the broad sense: it is documented, categorized, classified by type of vulnerability targeted and by severity level. The response generated by the model is then annotated: compliant or non-compliant with the system’s safety policies? If non-compliant, which policy was violated, with what severity, and in what context? These annotations feed the safety datasets used for safety fine-tuning or to calibrate output filtering systems.

The red teamer’s posture and method

Red teaming is not random prompt generation. It requires a deep understanding of model mechanisms, methodical creativity to explore varied and complementary attack angles, and annotation rigor to document each attempt with sufficient precision to be actionable. The most effective red teamers combine technical knowledge (understanding of context windows, role-playing mechanisms, prompt injection, chaining attacks) with compliance culture: knowledge of the model’s usage policies, categories of prohibited content, and the boundary between creative use and harmful use. In domains such as healthcare, law or finance, red teamers must additionally master the vocabulary and risk landscape of the domain to design attacks that are relevant to the actual risks the model might generate in that deployment context.

Specialized LLMs: when text annotation requires domain experts

Developing specialized LLMs for domains such as law, medicine, accounting or finance raises specific requirements for text annotation. A generalist annotator can compare two conversational responses and judge which is more helpful or better formulated. But they are rarely able to evaluate whether a response about diagnostic criteria for a medical condition, the interpretation of a contractual clause, or accounting consolidation rules is correct on substance. In these domains, a factual error in training data produces a model that asserts inaccurate things with confidence, which is a potentially dangerous outcome for its users.

Text annotation for specialized LLMs must therefore mobilize expert annotators: physicians for clinical corpora, legal practitioners for legal corpora, certified accountants or financial analysts for financial corpora. These experts work as a complement to generalist annotators rather than a replacement. They handle substantive validation tasks (factual accuracy, regulatory compliance, absence of medical or legal error) while generalist annotators cover formal aspects: writing quality, readability, structure, stylistic consistency. This hybrid model optimizes costs while maintaining the level of rigor these sectors require. An instruction-response pair about drug dosage must be validated by a healthcare professional; assessing its readability or length can reasonably be delegated to an annotator trained on the project’s writing quality criteria.

This logic reflects the approach adopted for other complex text annotation for AI projects, where the complementarity between expert profiles and generalist profiles makes it possible to reach quality levels neither would achieve alone. Applied to text annotation for domain-specific LLMs, this organizational model allows building expert-grade datasets without mobilizing physicians or lawyers on mechanical tasks that do not require their level of expertise.

Quality and governance of text annotation for LLMs

The quality of a post-training dataset for LLMs is significantly harder to measure than in classical annotation tasks. In NER or document classification projects, inter-annotator agreement is calculated on relatively binary decisions: this token sequence is an entity of type Organization, or it is not. In a response ranking task for RLHF, the decision is inherently subjective: two reasonable, well-trained annotators acting in good faith may legitimately prefer two different responses depending on the relative weight they assign to safety, helpfulness, conciseness or tone. This subjectivity does not invalidate text annotation for RLHF, but it imposes specific management requirements that the quality processes of classical NLP projects do not always address.

Inter-annotator agreement and calibration in RLHF projects

Measuring inter-annotator agreement remains relevant in preference annotation projects, but it must be interpreted differently than in classical tasks. An agreement rate of 70 to 80% on complex preferences is generally considered satisfactory in well-structured projects; below that threshold, it signals that guidelines are ambiguous, that judgment criteria are insufficiently hierarchized, or that annotators have not been calibrated on edge cases. Calibration consists of having multiple annotators label the same examples, analyzing their divergences, and organizing discussion sessions to converge on a shared interpretation of the criteria. These sessions are most effective when they deliberately focus on difficult cases: not the obvious preferences, but those where the tension between multiple criteria is real and the choice depends on a hierarchy that must be shared across the team.

Gold standards are also valuable in this context, even though building them is more complex than in other text annotation tasks. Reference examples annotated and validated by project leads make it possible to verify that production annotators remain aligned over time, particularly as guidelines evolve or new task categories are introduced into the project scope. Inserting these reference examples into regular annotation queues (sometimes called honeypots or gold items) is a well-established method for detecting quality drift before it affects the entire dataset. The management of this subjectivity parallels the challenges discussed in our article on managing subjectivity in text annotation for sentiment analysis, which covers comparable calibration mechanisms in a different subjective judgment context.

Documenting post-training data: a growing regulatory requirement

The EU AI Act places obligations on developers of high-risk AI systems and providers of foundation models to document their training data practices. Article 10 of the regulation requires that data used for training be relevant, representative, and as free from errors as reasonably practicable. For post-training data, this requirement means tracing the origin of each example, the selection criteria applied, the profiles of the annotators who made the judgments, and the quality control procedures implemented. A text annotation dataset produced without adequate documentation exposes its users to difficulties during regulatory audits, but also to operational risks if data quality has never been formally assessed and recorded.

Documenting post-training datasets also reflects broader AI data governance best practices: versioning datasets at each guideline revision, tracking changes, documenting known biases and mitigation measures, retaining quality audit results. These practices are not solely regulatory obligations. They are, above all, what enables teams to iterate effectively when a model exhibits unexpected behaviors in production, by making it possible to trace problems back to their source in the data rather than formulating hypotheses about architecture or hyperparameters.

Designing and executing a text annotation project for LLM post-training requires precisely defining the tasks and their sequencing, selecting annotators whose profiles match the domain requirements, building calibration and quality control processes adapted to the subjective nature of preference judgments, and documenting every stage with the rigor that both regulatory stakeholders and research teams require. Teams that master this pipeline consistently produce stable, reproducible and auditable results. To discuss your LLM data project, the Infoscribe team is available to assess your requirements and propose an approach calibrated to your volume, quality and timeline constraints.

Tags

Découvrez nos articles