badge icon

This article was automatically translated from the original Turkish version.

Blog
Blog
Avatar
AuthorGörkem SevinçNovember 18, 2026 at 4:00 AM

Hallucinations in Language Models Part 1: Causes and Mitigation Methods

T3 AI+1 More
Quote
T3 AI Developer
T3 AI Developer

A language model’s incorrect answer does not always appear disjointed or nonsensical. The model may sustain the rhythm of a genuine poem, assign an academic title to a nonexistent publication, or confidently alter information from its source. The hallucination problem emerges from the distinction between this surface fluency and factual accuracy. For reliability, it is necessary to evaluate not only how the answer appears but also what claims it makes, what they are based on, and when intervention should occur during generation.


This article is the first part of a two-part series titled Hallucinations in Language Models. The causes of hallucinations are explained starting from the objectives of language modeling, and evaluation criteria for preserving correct answers through detection and intervention methods are examined. The primary example used is our Independence March experiment conducted with the Gemma 4 models. In the second part, we will detail the control layers and implementation steps of our Özsezi architecture. The term Özsezi refers to the process of linking signals derived from the model’s internal operations to generation decisions.


By the end of this first article, readers will be able to define what constitutes an error in their own applications, read token uncertainty without conflating it with factual accuracy, and test a reduction method using appropriate criteria. Knowledge of probability distributions and basic model inference is sufficient; every variable used in equations is explained in its respective section. The second article builds on this foundation by extending it through model access, control artifacts, and how generation decisions are practically implemented.

What Error Does Hallucination Define?

In the context of a large language model (LLM), hallucination is used to describe content that is presented as true but is factually incorrect or inconsistent with the source material provided for the task. The scope of this definition varies across studies. Therefore, before establishing a detection system, it is essential to clarify which type of error is being targeted. Factual accuracy and fidelity to the given document are not the same evaluation axis.【1】


Factual accuracy questions whether a claim aligns with reliable external knowledge. Fidelity to the source examines whether the response accurately represents the provided text. A piece of information that is in fact true can still be problematic if, in a summarization task, it is attributed to a document where it does not appear. Conversely, a document may contain false information; faithfully reproducing it does not make that information correct in the external world.


The label “Not Supported” must also be used carefully. The absence of a claim in the available document does not prove it is false. Situations must be distinguished where a claim is verified, contradicted, or cannot be evaluated with current evidence. If the system mistakenly equates lack of evidence with falsehood, it will unnecessarily suppress true information that is absent from the source.


Table 1: Mapping Error Types to Verification Tasks

Doğruluk ve kaynağa sadakat için ayrı değerlendirme eksenlerini gösteren şema.

Accuracy and Fidelity to Source (Generated by Artificial Intelligence.)


This distinction is particularly important in multicomponent systems. A format validator can demonstrate that a JSON output is syntactically valid; it cannot verify the truth of claims regarding dates or sources within the content. Similarly, rejecting a harmful request is a different decision from assessing factual accuracy. A system’s ability to intervene in all these tasks does not require treating them as a single error class.【2】

The Distinction Observed in the İstiklal Marşı Task

In our experiment, models were asked to generate the first two stanzas of the İstiklal Marşı. The small model google/gemma-4-E4B-it【3】 struggled to reproduce the first stanza correctly and produced rhyming but incorrect lines in the second stanza. With google/gemma-4-31B-it【4】, the first stanza was accurately reproduced, but a similar distortion occurred in the second stanza. Model identifiers were used as named on official model cards; the term E4B does not correspond to the total number of parameters.


This task is not creative poetry composition. The goal is the accurate reproduction of an existing text. Therefore, a line’s meaningfulness, its rhyme with the preceding line, or its evocation of the style of a national poem cannot serve as criteria for success. Evaluation must be based on fidelity to a selected reference version. For future repetitions, an official reference text must be predetermined.


In the next phase of the experiment, without altering the weights of the small model, our three control layers were activated together. The correct text was neither prompted nor appended from an external source. These layers, named Content Filter, Direction Balance, and Path Intuition, respectively leverage logits processors, activation control along the behavioral axis, and predictions of the expected outcome along the generation path; these ideas were adapted to meet the requirements of our implementation. When all three layers were activated together, the small model produced the first two stanzas without error. Thus, it was observed that the same weights could yield a correct output through controlled intervention in the generation process.


The key insight from this case is this: A model’s initial incorrect response does not prove that it lacks the capacity to generate the correct answer. Achieving the correct output using the same weights and without adding the source text supports the interpretation that the correct text can be extracted from the model. However, this result is not equivalent to directly observing the content of the pretraining corpus. How the text was encoded during training and whether the model can reliably reproduce it under a specific inference regime are distinct claims.


This section presents qualitative results from a specific task. Since no repeated success rate is provided, one cannot conclude from this experiment that the small model is generally superior to the 31B model or that the same gain will be achieved on every question. In the second section, the three layers activated in our experiment are separately described alongside the optional components of our larger architecture.

How Does a Language Model Learn the Goal of Accuracy?

An autoregressive language model generates the distribution of the next token given the input question and preceding tokens. The model’s raw scores, called logits, are converted into probabilities via a softmax transformation. The probability of an entire response can be written as the product of successive conditional token probabilities.


Equation 1: Response Probability

Here, q denotes the question or prompt, y the response, T the response length, and θ the model parameters. The common objective in pretraining is to minimize the negative log probability assigned to the next token in the data.


Equation 2: Language Modeling Loss

Interpreting this objective as “the model only completes words, it does not learn information” is misleading. To predict the next token accurately, the model must learn linguistic structures as well as facts, relationships, and regularities of the world. The problem is that this learning does not translate into an explicit contract that enforces accuracy in every generation. Errors, rare facts, or multiple plausible explanations present in the data are all subject to the same learning process.【6】


In the İstiklal Marşı example, the poetic form learned by the model may conflict with the goal of accurately reproducing the correct text. Once the first incorrect line is generated, subsequent tokens treat this erroneous continuation as context. Rather than reverting to the original text, the model may begin to consistently extend the newly created poem. This mechanism is considered a plausible explanation for the behavior observed in our experiment. Since no internal activation analysis is presented here, this interpretation should not be treated as a directly measured mechanistic finding.


The path chosen during generation is also important. Greedy decoding selects the token with the highest probability at each step. Sampling-based generation selects tokens from the probability distribution. Greedy selection does not guarantee the most probable overall response, nor does it guarantee the most accurate one. Reducing temperature narrows generation diversity; in cases where a strong but incorrect continuation dominates, it may reinforce the same error more persistently.


Greedy selection’s limitation can be illustrated with a small tree. Suppose at the first step, the probability of path A is 0.60 and that of path B is 0.40. The most probable continuation from A is 0.50, and from B is 0.95. The probabilities of the two-step paths are then 0.30 and 0.38 respectively. Greedy selects A at the first step without considering the second-step outcome. This is a purely illustrative probability example; it is not a measurement from a Gemma run. Moreover, even finding the most probable complete sequence does not guarantee factual accuracy: The model’s probability objective remains distinct from the task’s accuracy criterion.


The context-altering effect of incorrect continuations is also related to this distinction. When a model alters a single line during a task requiring exact text reproduction, the next step’s question is no longer merely “What comes next in the original poem?”; it also becomes conditioned by which continuation best fits the generated erroneous line. An error need not end with a single word—it can sustain a new pattern. The diagram below illustrates this possible mechanism; it is not a recorded token trace from the previous İstiklal Marşı trial.【7】

Impact of Incorrect Continuation on Production Context (Generated by Artificial Intelligence.)

Different Causes Feeding Hallucinations

Incomplete and Contradictory Information

Not every phenomenon is sufficiently represented in training data. While the model succeeds with frequently encountered patterns, it may produce incorrect completions about rare entities—such as obscure literary works, local historical details, or specific individuals—by extrapolating from similar patterns. Another scenario arises when information changes after training: a response that was once correct for the model may become inaccurate relative to the historical context of the question.


Contradictory data must also be addressed. Different dates, names, or accounts may exist for the same event. The model may not reliably distinguish which version represents an authoritative source, which is an outdated variant, or which is an interpretation. The solution is not merely adding more data; it also requires evaluating the quality and temporal scope of the sources.

Information Access and Query Form

Learning a piece of information during training does not imply the model can retrieve it with equal reliability across all query forms. The language of the question, the terminology used, the order of context, and the desired output format can all influence generation. Therefore, a distinction must be investigated between “the model does not know” and “the model failed to use the correct information in this query.”


This distinction is further elaborated in Zeyuan Allen-Zhu’s lecture on information storage, retrieval, and usage: reaching a correct outcome does not by itself reveal which specific capability produced it. A similar question-answer pair may have been seen during training; the same result could also be generated by combining separately learned pieces of information in a novel question. In the case of an incorrect answer, the possibilities must be separately evaluated: the information was never learned, it cannot be retrieved under this query, or the correct information was retrieved but processed incorrectly.【8】


This distinction can be concretely illustrated with a Turkish example. Suppose a completely fabricated training record contains the fact “Deniz Kaya was born in 1984.” The correct answer to the question “Was Deniz Kaya born in a leap year?” is “yes.” However, it cannot be determined solely from the answer whether this result was generated by retrieving the birth year and applying the rule for leap years, or by recalling a previously seen equivalent question-answer pair. The diagram below separates the possible causes of success and failure in this same question; it does not provide a definition of how an actual model operates internally.【9】


Kurmaca Deniz Kaya’nın 1984 doğum yılı üzerinden, doğru ve yanlış cevaplarda öğrenme, bilgi çağırma, kavram ve bilgi birleştirme ayrımını açıklayan Türkçe şema.

Learning, Retrieving, and Using Information (Generated with Artificial Intelligence.)

A critical point from the training perspective is that merely repeating the same information does not guarantee its usability across different phrasings and question formats. In Allen-Zhu and Li’s controlled synthetic biography experiments, presenting information through varied expressions, altering sentence order, and clarifying relationships to the subject affected the model’s success in retrieving the information during subsequent question-answer tasks.【10】 In a second study, difficulties were also observed when performing simple classification or comparison tasks on retrievable information. Improvements seen when appropriate intermediate information is generated do not imply that all hallucinations in all models can be resolved by the same method.【11】


In our own evaluation framework, this distinction can be concretely tested with three short controls: first ask “In what year was Deniz Kaya born?”, then “Is 1984 a leap year?”, and finally pose a question combining both pieces of information. If the separate questions are answered correctly but the combined question is answered incorrectly, this suggests the error lies in the information integration stage. This pattern should be tested by varying question formulations, personal names, and unseen examples. These controls narrow the potential error domain but do not by themselves prove how information is stored in the weights.


In our İstiklal Marşı trial, the ability to extract the correct text from the same weights must also be considered within this framework. The observed result is a task-specific finding demonstrating that a failed response does not fully characterize the model’s available capacity. However, it cannot be determined from this result alone which training examples were seen or which internal mechanisms determined success. The scope of interpretation must be explored through varied query types, repeated trials, and control conditions without source texts.

False Premise and Error Accumulation

A question may request a summary of a book that does not actually exist. If the model accommodates the summarization format without first questioning the book’s existence, the entire response may be built around a false premise. Similarly, an incorrect intermediate result in a long solution can lead to subsequent steps that are internally consistent yet entirely wrong.


Verification here must not consist solely of scoring the final sentence. Error-prone components such as source identity, intermediate calculations, entity matching, or versioning of supporting documents can also be audited. The verification of a calculator’s arithmetic and the verification that a search system demonstrates a publication actually exists are distinct types of validation contributions.

Evaluation That Encourages Guessing

In an evaluation where both incorrect answers and “I don’t know” responses receive zero points, guessing under uncertainty can increase the expected score. Kalai and colleagues jointly examine statistical errors in pre-training and how evaluations can reward guessing rather than acknowledging uncertainty. The resulting engineering insight is that reliability cannot be reduced solely to the rate of correct answers.【12】


Hesitation alone cannot be an objective. A system that rejects every question may reduce erroneous outputs but will not serve as a useful assistant. The desired approach is a policy that preserves answers to answerable questions while allowing verification, regeneration, or hesitation in risky situations.

Why Does Token Confidence Diverge from Answer Accuracy?

A high probability assigned to a token indicates that the continuation is strongly supported by the model’s distribution. This value is not directly the probability that “this sentence is true.” In cases where multiple correct formulations exist, the distribution may be broad. Conversely, a false relationship that the model has learned strongly can also be generated with high probability.


It is helpful to observe this distinction on a single generation sequence. In the word cards below, the representative probability of the most likely continuation is shown as bars. A shorter bar indicates that the choice has become less dominant; colors are not labels of factual truth. This visualization helps identify which points to scrutinize, especially when generating numbers or proper names. The cards display words at the word level for readability; the actual model may split a single word into multiple tokens.


Uncertainty Observer's Word Cards (Generated with Artificial Intelligence)

Uncertainty Monitor records such signals. Whether intervention is needed is the responsibility of the subsequent policy layer. Thus, the step between a drop in probability and the imposition of an incorrect answer becomes visible.


In generation telemetry, the probability of the most likely token p₁, the probability of the second most likely token p₂, and the margin between them can be tracked.


Equation 3: Probability Margin

Entropy, on the other hand, summarizes how spread out the distribution is in a single step:


Equation 4: Token Entropy

High entropy may indicate that alternatives are close in probability; this may stem from information gaps, linguistic variation, or a difficult generation point. Low entropy does not rule out the model being confidently wrong. Additionally, tokenizers, temperature, logit interventions, and text regions can alter these values. A threshold calibrated on one model may not carry the same meaning when transferred to a new model.

Reading Margin and Entropy in a Small Example

In an artificial generation step with three candidates, suppose the probabilities are 0.70, 0.20, and 0.10. The margin between the first two candidates is 0.50; the entropy, calculated using the natural logarithm, is approximately 0.802 nats. In a more uniform distribution with probabilities 0.40, 0.35, and 0.25, the margin drops to 0.05 and the entropy rises to approximately 1.081 nats. In the second distribution, the choice is more uncertain; however, the correct candidate cannot be determined from these numbers alone.


Table 2: Margin and Entropy in Two Artificial Token Distributions


Token Consistency and Response Accuracy (Generated by Artificial Intelligence.)

These numbers are not the result of any experimental trial derived from a model. The dominant candidate may be an incorrect proper noun; different plausible initial states may still converge on the same correct answer. The number of segments into which a real tokenizer splits words also affects the outcome. Therefore, it must be remembered that the monitor measures uncertainty at the token level while the accuracy label is determined separately at the task level.


Calibration answers a different question: When the system assigns a specific level of confidence to similar examples, does that confidence align with the observed accuracy? A score that effectively ranks correct answers above incorrect ones can still be poorly calibrated in terms of probability. Therefore, ranking performance, probability calibration, and the impact of decision thresholds must be measured separately.


For Turkish, the agglutinative structure, the splitting of proper nouns across multiple tokens, and orthographic variations must also be considered. Low token probabilities observed during the generation of a word in multiple parts do not by themselves indicate that the information about that word is incorrect. This constitutes a design rationale requiring separate thresholds and error analysis for Turkish; it is not a measure of overall failure rate across all Turkish models.


Change in Token Probability and Margin (Generated by Artificial Intelligence.)

The distribution of a single step is an instantaneous snapshot; the curve traced over the entire generation process reveals when uncertainty began and how long it persisted. In the example below, the highest probability and margin have been normalized and computed from synthetic token distributions. The shaded region indicates steps that satisfy the defined threshold rule; this area has not been labeled as a hallucination.


When interpreting the curve, three questions are distinguished: How uncertain is the distribution, how many steps does this uncertainty last, and what claim is being generated from the task perspective? The first two questions can be answered using telemetry; the third requires task-specific knowledge or evidence. In the second section, the word filter is explained in terms of how it connects these measurements to the decision to intervene.

How Are Detection and Mitigation Methods Completed?

Source-Supported Generation and Claim Verification

Retrieval-augmented generation (RAG) enhances responses by incorporating relevant external documents rather than relying solely on parametric knowledge. The work by Lewis and colleagues is a foundational example of this approach, which integrates a parametric model with accessible external memory. Using sources can provide access to up-to-date or domain-specific information.【13】


However, retrieving a document is not the same as verifying a claim. The retrieved document may be incorrect, outdated, irrelevant, or only partially related to the question. The model may also misinterpret a correct document. Therefore, the source identity, the relevant passage, the scope of the claim, and temporal information must all be preserved together. Adding a URL at the end of a response does not demonstrate that all sentences in the response are supported by that source.

A brief example illustrates this distinction. If the source only states, “The application closes on May 15,” then asserting in the response that results will also be announced on the same day adds a calendrical relationship not present in the source. The system can accurately report the closing date supported by the source; it must state that no information is available regarding the announcement date of results. This example represents a hypothetical task, not a raw output from a project experiment.


Making this distinction explicit through three claims is more illustrative. Suppose the instructional document contains only the phrase, “The final application date is May 15.” The claim “The final application date is May 15” is directly supported. The claim “The final application date is May 16” contradicts the document. The claim “Results are announced on May 15” introduces a claim not present in the document. The falsity of this final claim has not yet been demonstrated; it has only been shown that it is unsupported by the source. Labeling these three cases differently enables the verifier to more accurately analyze both genuine errors and unnecessary assertions.


Document-Based Claim Types (Generated by Artificial Intelligence.)

In a Turkish information question, source fabrication can be similarly disaggregated. When a user requests the first Turkish publication of a specific method along with its DOI number, the model may generate an academic-looking citation. The verifier’s first task is to verify whether the title, authors, publication year, and identifier genuinely belong to the same work. The second task is to determine whether the identified work actually supports the claim in question. Linking an existing DOI to an unrelated publication is another type of error that can pass a mere existence check.

Therefore, source verification consists of two steps: first, confirming the identity of the source; second, verifying the support relationship between the claim and the passage. A search returning no results does not prove that the publication does not exist. When sufficient evidence is unavailable, the correct system response is not to present a verified citation but to acknowledge this limitation or request additional verification. These examples are constructed to illustrate the method; they are not raw model outputs from the project.

Establishing an Accuracy Contract in Your Application

The first output of an integration is a brief task contract that defines under which conditions a response is acceptable. Translating an original poem, extracting a date from a document, and generating an open-ended explanation cannot be measured by the same validator. In the Independence March task, the desired output is two original lines from the anthem; writing a synonym for a word is a fidelity error. In a document-based question, however, the same meaning can be correctly expressed using different phrasings. This distinction must be made first, followed by the selection of an appropriate evaluator.


The end-to-end application of a document example can also be defined by the same contract. The application will generate an answer to the question “When is the final deadline?” by extracting the passage “Final deadline is May 15” from a document whose identity and version are stored. The producer’s input consists of the question, the relevant passage, and the desired output format. The evaluator’s record includes the generated claim, the exact location of the passage, and a support label. When the answer is “The application closes on May 15,” the date claim is supported. If the answer is extended to “Results will also be announced on the same day,” there is no information to support the second claim. The truth of the first claim does not compensate for the lack of evidence for the second.


The contract also specifies the conditions under which evidence is considered sufficient, how to respond to missing information, and the form of hesitation. A document-limited assistant must not guess a date when the passage contains no date information. It can respond to the user with “The given document does not contain the final deadline date.” In an open knowledge task, if additional source searching is permitted, that path may be explored first. These decisions define product behavior and provide clearer control than simply appending “If you are unsure, say so” at the end of the request.


For initial setup, a small but diverse set of tasks can be prepared: directly supported claims, conflicting dates in the source, details absent from the source, and questions based on false premises are all included. Each example is annotated with the expected decision. This allows measurement not only of systems that find correct answers but also of systems that respond appropriately when evidence is insufficient. If the number of examples is insufficient to draw conclusions about the target error rate, the study is reported as a pilot.

Multiple Responses and Semantic Ambiguity

Generating different responses to the same question can reveal where the model is uncertain. However, differences at the word level must be distinguished from disagreements at the semantic level. “Ankara” and “Ankara is the capital of Türkiye” are different texts but convey the same core answer. Semantic entropy addresses this distinction by evaluating outputs within clusters of meaning.


Even if many candidates produce the same answer, this does not guarantee accuracy. A shared misconception can be repeated across all candidates. In the Independence March task, different candidates might agree on the same fabricated line. Therefore, multiple generation does not eliminate the need for source verification or independent error analysis; it merely provides an additional observational channel at the cost of additional computation.

Extracting Accuracy Signals from Internal Representations

The model’s hidden states and attention patterns can carry richer information than selected tokens alone. In Gnosis’s original work, a small learned structure is used to predict accuracy from frozen models’ internal traces. Summaries of hidden states and attention flows are combined within this structure.【14】 The features used in our Gnosis accuracy head and the distinctions from the original work are explained in the second section.


Such a head is a predictor trained for accuracy. The scores it produces are bounded by the limits of the training labels and the evaluation distribution. A signal useful within one model family or task type may not transfer with the same success to another family or generation style. A reliable decision policy cannot be established without acknowledging that the system evaluating the response may also make errors.

Intervention and Computational Control During Generation

Logits processors intervene in the distribution before the next token is selected. When confidence remains low, generation can be terminated, redirected to an alternative token, or a safe fallback expression can be used. NVIDIA’s logits processor zoo provides an interface for such interventions; the term “hallucination prevention” in the class name alone does not guarantee factual accuracy.【15】


Activation limiting operates at another level: hidden representations are constrained to steer behavior in a specific direction. The Assistant Axis study examines drift in assistant personality and aims to enforce behavioral stability through targeted interventions. It would be incorrect to present this approach as a source verifier; its factual contribution must be evaluated separately within the target application.【16】

Tespit sinyali ile kontrol aksiyonu farklı katmanlarda tanımlanır.

Detection Signals and Control Actions (Generated by Artificial Intelligence.)


ZIP-RC generates predictions about the reward and remaining length at the end of a generation prefix. These signals can be used to determine which path to continue, which path to prune, or when to initiate a new candidate. The fact that the original method does not require additional forward passes does not mean the total cost of candidate generation and control logic is zero.【17】


In our Gnosis design, signals from these studies are integrated within the same generation pipeline; an intervention order is defined, different thresholds are applied for reasoning and final answer regions, and the final decision is linked to the context of supporting evidence. Adaptations were developed where the original methods failed to meet our target application’s requirements. In the second section, we illustrate which ideas were drawn from which studies and how they were completed within our architecture.

How Is the Benefit of Intervention Understood According to Which Criteria?

For a detection system, the positive class must be clearly defined. If the positive class is “incorrect answer,” the metric code must consistently interpret high scores as indicating either error or correctness. AUROC summarizes rankings across different thresholds; AUPRC is sensitive to the prevalence of the chosen positive class. Therefore, metrics should not be compared without specifying class definitions and the distribution of examples.

For probability calibration of accuracy predictions, the Brier score is defined as:


Equation 5: Brier Score

Here, yᵢ is 1 for a correct answer and 0 for an incorrect answer. The score penalizes both overconfidence and incorrect predictions but does not fully capture all calibration properties. Reliability diagrams, which partition predictions by estimated confidence scores, and task-specific outcomes provide additional insight. The distinction between calibration data, data used to select the decision threshold, and final test data must also be preserved.


For evaluating decision policy success, coverage rate is the proportion of requests to which the system provides an answer. Selective risk indicates the error rate within the subset of answered requests.


Equation 6: Coverage Rate and Selective Risk

aᵢ is 1 when the system responds to request i and 0 otherwise. If no response is given, the denominator of the second expression becomes zero; the risk value cannot be automatically reported as zero accuracy. A reduction in the rate of incorrect answers achieved by rejecting many more questions must be clearly recognized as a cost.

Calculating the Impact of the Threshold Within the Same Set of Answers

The following six answers are artificially selected for illustrative purposes. Each row presents a fixed candidate answer, its assigned accuracy score, and an independent reference evaluation. This table does not report the performance of Özsezi or Gemma models.


Table 3: Six Artificial Candidate Answers Used for Threshold Calculation


If only answers with a score of at least 0.80 are shown, the first three rows are selected. Coverage is 3/6, or 50 percent. Since one of the three selected answers is incorrect, selective risk is 1/3, approximately 33.3 percent. When the threshold is lowered to 0.60, the fourth answer is also included: coverage becomes 4/6, approximately 66.7 percent, and risk drops to 1/4, or 25 percent. In this small set, relaxing the threshold reduced risk because the newly accepted answer was correct. In a finite sample, it cannot be assumed that risk always changes monotonically with the threshold.

Decision Threshold, Coverage, and Risk (Generated by Artificial Intelligence.)


For the Brier score, the square of the difference between each row’s predicted probability and the true label (0 or 1) is computed. The sum of squared errors is 1.4875; dividing by six yields approximately 0.2479. The third row, which contains a single high-confidence incorrect answer, contributes 0.7225 on its own. This example illustrates why ranking correctness, calibration of probabilities, and decision success at a chosen threshold are distinct questions.


When evaluating false suppression, the denominator must also be clearly defined. Here there are four correct candidates in total. When the threshold is 0.80, two of these are suppressed; when it is 0.60, one is suppressed. Within this fixed set of candidates, the suppression rates for correct answers are respectively 2/4 and 1/4. In an intervention that alters the candidate set, a new candidate may arise for the same question; in such an experiment, the raw accuracy of the candidate and the accuracy of the answer presented to the user must be tracked separately.


Table 4: Quality and Cost Metrics to Be Reported Together


For exact replication tasks such as the İstiklal Marşı, line-by-line accuracy, line order, and missing or extraneous content can be measured. Punctuation and Unicode normalization must be predefined; normalization must not be so broad as to convert incorrect words into correct ones. A semantically similar line is not accepted as correct because the task requires fidelity to the original text.


In the next experiment, the non-intervention conditions of two models and the intervention condition of the smaller model must be repeated on the same task set. In addition to the full composition, conditions where components are evaluated individually must also be included. To avoid generalizing from a single poem, fixed texts of varying lengths, factual questions, and document-based tasks can be added. When success rates, repetition counts, and costs are reported together, it becomes possible to assess the extent to which the main finding generalizes.

How Is a Threshold Selected Under a Product Constraint?

Threshold selection is not merely about seeking the highest accuracy percentage. First, the application’s acceptable risk for unanswerable responses, the suppression margin for correct answers, and the latency limit are defined. The goal is to choose among policies that satisfy these constraints while maximizing responsiveness to user requests. For example, θ represents thresholds jointly selected with settings such as patience and intervention magnitude. A representative selection problem can be formulated as follows:


Equation 7: Maximize Coverage


This objective is evaluated under the following constraints:


Equation 8: Risk Suppression and Latency Constraints

Here, ρ is the acceptable risk, η is the suppression limit for correct answers, and B is the budget for the 95th percentile latency. The denominator of FS consists of candidates correctly identified by an independent reference. These limits are determined according to the use case; the illustrative thresholds such as 0.50 and 0.80 in this paper are not production recommendations. If no candidate satisfies the defined constraints, the result is “No suitable policy found”; adjustments on the final test set must not falsely appear to achieve the target.


In practice, control assets are first learned from preparation data. Candidate policies are tested on a separate development dataset; if sufficient data is available for calibration, a dedicated section is used for score transformation. Filtering only final responses can be recomputed within a fixed candidate set. However, token or activation interventions alter the output, so each candidate policy must be rerun through the actual production pipeline. Once settings are selected, all assets are locked and evaluated once on an untouched test set.


Results must be accompanied by sample size and uncertainty intervals. The absence of errors in a small number of accepted responses does not imply zero true risk. Results must also be separated by task type: a threshold effective in poetry translation may not maintain the same coverage in Turkish question answering. This approach transforms an impressive single example into a viable engineering decision.

Why Is Managing the Inference Process Important?

There is no single cause of hallucination nor a universal solution for all tasks. Data deficiency, incorrect premises, source inconsistency, and reinforcement of erroneous continuations during generation each require different interventions. Model size alone cannot determine all these issues. Source access, an appropriate controller, calibration, and decision policy also shape system behavior.


The significance of the İstiklal Marşı case lies in achieving a correct output using the same unmodified weights of a small model. This observation indicates that incorrect answers cannot always be explained solely by lack of information. The second part of the series, Özsezi and Production Control, explains how text filtering, directional balancing, and path intuition are integrated within the same generation cycle. Accuracy is addressed in the context of its place within a broader architecture that includes multiple generation and final decision layers.

Additionally, an Example Evaluation Flow

The following pseudocode describes the evaluation protocol we propose for testing the method. This flow is not presented as an experimental result log. The raw output without intervention and the intervened output are stored separately. The reference is used only for evaluation and is not provided to the model under sourceless conditions.


Table 5: Algorithm 1 – Evaluation Protocol


A critical feature of this arrangement is that it does not discard failed responses or prematurely terminated trials. Presenting only successful examples may overstate the effectiveness of the control policy. For the same reason, selecting the best-performing prompt after the fact necessitates separating the exploration phase from the validation phase.

Production Control with Self-Reflection in Part Two

This first section demonstrated that reducing hallucinations requires first defining the correct response, separating uncertainty signals from task accuracy, and measuring intervention in terms of both coverage and cost. The outstanding practical question is how to translate these principles into a functioning production system.


The continuation of this series, Hallucinations in Language Models Part 2: Production Control with Self-Reflection, addresses this question by returning to the case of the İstiklal Marşı. It step by step explains how the prompt filter affects token selection, how directional balance influences internal representations, and how path intuition intervenes in the generation process. It concretely illustrates which model access is required, how the control sequence is established, and how risky continuations are terminated without being shown to the user.


For readers wishing to apply this method to their own projects, the second section integrates data and state contracts, decision flows, and the integration of control layers. The reasoning and evaluation framework established in the first section thus become a practical integration design.

Bibliographies

Allen-Zhu, Zeyuan and Yuanzhi Li. “Physics of Language Models: Part 3.1, Knowledge Storage and Extraction.” Proceedings of the 41st International Conference on Machine Learning, PMLR 235 (2024): 1067–1077. Accessed November 16, 2026.https://proceedings.mlr.press/v235/allen-zhu24a.html

Allen-Zhu, Zeyuan and Yuanzhi Li. “Physics of Language Models: Part 3.2, Knowledge Manipulation.” arXiv 2023. Accessed November 17, 2026.https://arxiv.org/html/2309.14402v2

Farquhar, Sebastian, Jannik Kossen, Lorenz Kuhn, and Yarin Gal. “Detecting Hallucinations in Large Language Models Using Semantic Entropy.” Nature 630 (2024): 625–630. Accessed November 12, 2026.https://www.nature.com/articles/s41586-024-07421-0

Ghasemabadi, Amirhosein and Di Niu. “Can LLMs Predict Their Own Failures? Self-Awareness via Internal Circuits.” arXiv 2026. Accessed November 12, 2026.https://arxiv.org/html/2512.20578v2

Google DeepMind. “Gemma 4 31B IT.” Model card. Hugging Face. Accessed November 12, 2026.https://huggingface.co/google/gemma-4-31B-it

Google DeepMind. “google/gemma-4-E4B-it.” Model Card. Hugging Face. Accessed November 12, 2026.https://huggingface.co/google/gemma-4-E4B-it

Huang, Lei, Weijiang Yu, Weitao Ma, et al. “A Survey on Hallucination in Large Language Models: Principles, Taxonomy, Challenges, and Open Questions.” arXiv 2024. Accessed November 17, 2026.https://arxiv.org/pdf/2311.05232v2

Kalai, Adam Tauman, Ofir Nachum, Santosh S. Vempala, et al. “Why Language Models Hallucinate.” arXiv 2025. Accessed November 17, 2026.https://arxiv.org/html/2509.04664v1

Lewis, Patrick, Ethan Perez, Aleksandra Piktus, et al. “Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks.” arXiv 2021. Accessed November 17, 2026.https://arxiv.org/pdf/2005.11401v4

Lu, Christina, Jack Gallagher, Jonathan Michala, et al. “The Assistant Axis: Situating and Stabilizing the Default Persona of Language Models.” arXiv 2026. Accessed November 12, 2026.https://arxiv.org/html/2601.10387v1

Manvi, Rohin, Joey Hong, Tim Seyde, et al. “Zero-Overhead Introspection for Adaptive Test-Time Compute.” arXiv 2025. Accessed November 12, 2026.https://arxiv.org/html/2512.01457v4

NVIDIA. “logits-processor-zoo.” GitHub. Accessed November 12, 2026.https://github.com/NVIDIA/logits-processor-zoo

T.C. Millî Eğitim Bakanlığı. “TBMM’nde İstiklâl Marşı Görüşmeleri ve Kabulü.” Accessed November 12, 2026.https://meb.gov.tr/istiklalmarsi/istiklalmarsi/Meclisten/Kabulu

Zeyuan Allen-Zhu, Sc.D. “Physics of LM: Part 3.1 + 3.2, Knowledge Storage, Extraction and Manipulation.” YouTube, November 4, 2023. Accessed November 16, 2026.https://www.youtube.com/watch?v=YSHzKmEianc

Citations

  • [1]

    Lei Huang, Weijiang Yu, Weitao Ma, et al. “A Survey on Hallucination in Large Language Models: Principles, Taxonomy, Challenges, and Open Questions.” arXiv 2024, 5-7. Accessed November 17, 2026.https://arxiv.org/pdf/2311.05232v2

  • [2]

    Huang, Yu, Ma et al., “A Survey on Hallucination in Large Language Models,” 5–7.

  • [3]

    Google DeepMind, “google/gemma-4-E4B-it,” Model Card, Hugging Face, Accessed November 12, 2026.https://huggingface.co/google/gemma-4-E4B-it

  • [4]

    Google DeepMind, “Gemma 4 31B IT,” Model card, Hugging Face, Accessed November 12, 2026.https://huggingface.co/google/gemma-4-31B-it

  • [6]

    Adam Tauman Kalai, Ofir Nachum, Santosh S. Vempala, et al. “Why Language Models Hallucinate,” arXiv 2025, Accessed November 17, 2026.https://arxiv.org/html/2509.04664v1

  • [7]

    Kalai, Nachum, Vempala et al. "Why Language Models Hallucinate."

  • [8]

    Zeyuan Allen-Zhu, Sc.D., “Physics of LM: Part 3.1 + 3.2, Knowledge Storage, Extraction and Manipulation,” YouTube, November 4, 2023. Accessed November 16, 2026.https://www.youtube.com/watch?v=YSHzKmEianc

  • [9]

    Zeyuan Allen-Zhu, “Physics of LM: Part 3.1 + 3.2, Knowledge Storage, Extraction and Manipulation,” YouTube.

  • [10]

    Zeyuan Allen-Zhu and Yuanzhi Li, “Physics of Language Models: Part 3.1, Knowledge Storage and Extraction,” Proceedings of the 41st International Conference on Machine Learning, PMLR 235 (2024): 1067–1077, Accessed November 16, 2026.https://proceedings.mlr.press/v235/allen-zhu24a.html

  • [11]

    Zeyuan Allen-Zhu and Yuanzhi Li, “Physics of Language Models: Part 3.2, Knowledge Manipulation,” arXiv 2023, Accessed November 17, 2026.https://arxiv.org/html/2309.14402v2

  • [12]

    Kalai, Nachum, Vempala, et al. “Why Language Models Hallucinate.”

  • [13]

    Patrick Lewis, Ethan Perez, Aleksandra Piktus, et al., “Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks,” arXiv 2021, 2-3, Accessed November 17, 2026.https://arxiv.org/pdf/2005.11401v4

  • [14]

    Ghasemabadi, Amirhosein, and Di Niu, “Can LLMs Predict Their Own Failures? Self-Awareness via Internal Circuits,” arXiv 2026, Accessed November 12, 2026.https://arxiv.org/html/2512.20578v2

  • [15]

    NVIDIA, “logits-processor-zoo,” GitHub, Accessed November 12, 2026.https://github.com/NVIDIA/logits-processor-zoo

  • [16]

    Christina Lu, Jack Gallagher, Jonathan Michala, et al. “The Assistant Axis: Situating and Stabilizing the Default Persona of Language Models,” arXiv 2026, Accessed November 12, 2026.https://arxiv.org/html/2601.10387v1

  • [17]

    Rohin Manvi, Joey Hong, Tim Seyde, et al. “Zero-Overhead Introspection for Adaptive Test-Time Compute,” arXiv 2025, Accessed November 12, 2026.https://arxiv.org/html/2512.01457v4

T3 AI
Türkiye's Large Language Model,is growing together with you.

Contents

  • What Error Does Hallucination Define?

  • The Distinction Observed in the İstiklal Marşı Task

  • How Does a Language Model Learn the Goal of Accuracy?

  • Different Causes Feeding Hallucinations

    • Incomplete and Contradictory Information

    • Information Access and Query Form

    • False Premise and Error Accumulation

    • Evaluation That Encourages Guessing

  • Why Does Token Confidence Diverge from Answer Accuracy?

    • Reading Margin and Entropy in a Small Example

  • How Are Detection and Mitigation Methods Completed?

    • Source-Supported Generation and Claim Verification

    • Establishing an Accuracy Contract in Your Application

    • Multiple Responses and Semantic Ambiguity

    • Extracting Accuracy Signals from Internal Representations

    • Intervention and Computational Control During Generation

  • How Is the Benefit of Intervention Understood According to Which Criteria?

    • Calculating the Impact of the Threshold Within the Same Set of Answers

    • How Is a Threshold Selected Under a Product Constraint?

  • Why Is Managing the Inference Process Important?

  • Additionally, an Example Evaluation Flow

  • Production Control with Self-Reflection in Part Two