Kahneman-Tversky Optimization (KTO) is a machine learning algorithm for aligning models with human preferences. Unlike Reinforcement Learning from Human Feedback (RLHF) or Direct Preference Optimization (DPO), which require pairwise comparisons, KTO is trained using simple binary signals—whether a single generated output is desirable or undesirable. This significantly reduces data collection complexity. The algorithm's core innovation is its loss function, derived from prospect theory by psychologists Daniel Kahneman and Amos Tversky, which models how humans perceive gains and losses asymmetrically.
Glossary
Kahneman-Tversky Optimization (KTO)

What is Kahneman-Tversky Optimization (KTO)?
Kahneman-Tversky Optimization (KTO) is a preference optimization algorithm that uses a loss function based on prospect theory, requiring only binary feedback on whether a single output is desirable or undesirable, rather than pairwise comparisons.
The KTO loss function treats desirable outputs as gains and undesirable ones as losses, applying a non-linear transformation that weights losses more heavily than equivalent gains. This mirrors human decision-making, where the pain of a loss is psychologically greater than the pleasure of an equivalent gain. By framing preference learning this way, KTO directly optimizes for the expected utility of a model's outputs according to this human-centric value function. It eliminates the need for a separate reward model, simplifying the alignment pipeline while maintaining robust performance on benchmarks for helpfulness and harmlessness.
Key Features of KTO
Kahneman-Tversky Optimization (KTO) is a preference optimization algorithm that uses a loss function based on prospect theory, requiring only binary feedback on whether a single output is desirable or undesirable, rather than pairwise comparisons.
Binary Feedback Requirement
Unlike methods like RLHF or DPO that require pairwise comparisons between two outputs, KTO operates on simple binary signals. For a given prompt, a single model output is labeled as either desirable (e.g., helpful, harmless) or undesirable (e.g., unhelpful, harmful). This significantly reduces the complexity and cost of data collection, as annotators do not need to make fine-grained relative judgments between two often similar responses.
Prospect Theory Loss Function
The core innovation of KTO is its loss function, derived from prospect theory. It treats desirable and undesirable outcomes asymmetrically, reflecting the human cognitive bias where losses loom larger than gains. The loss for generating an undesirable output is weighted more heavily than the reward for generating a desirable one. This asymmetry helps the model more aggressively avoid harmful or incorrect outputs while still learning to produce good ones. The mathematical formulation uses a sigmoid function applied to the difference in log-likelihoods between the policy and a reference model, scaled by a value function that assigns utility based on the desirability label.
Reference Model Regularization
To prevent reward overoptimization and catastrophic forgetting of general capabilities, KTO incorporates a KL divergence penalty relative to a reference model (typically the initial pre-trained model). This penalty acts as a regularizer, ensuring the fine-tuned policy does not deviate too far from the reference model's distribution. This maintains the model's core linguistic knowledge and coherence while steering its behavior based on the binary preference signals.
Implicit Reward Modeling
KTO bypasses the explicit training of a separate reward model, which is a complex and unstable component in the RLHF pipeline. Instead, it directly optimizes the policy using the prospect-theoretic loss. This eliminates issues like reward hacking that can occur when an agent exploits imperfections in a learned proxy reward. The alignment objective is baked directly into the policy update, simplifying the overall training stack and improving stability.
Handling Unlabeled Data
A practical advantage of KTO is its ability to utilize data where only some outputs have preference labels. The loss function can be applied only to labeled examples, while the KL divergence penalty regularizes the model's behavior on all data, including unlabeled prompts. This makes it suitable for real-world deployment where continuous feedback is sparse and binary (e.g., user thumbs-up/thumbs-down), enabling more efficient continuous model learning.
Comparison to DPO and RLHF
- vs. DPO: Both DPO and KTO avoid training a separate reward model. However, DPO requires a dataset of pairwise preferences, while KTO uses simpler binary per-example labels.
- vs. RLHF: RLHF involves a multi-stage pipeline: reward model training followed by reinforcement learning (e.g., PPO). KTO is a single-stage, supervised fine-tuning procedure, making it computationally simpler and more robust to the instabilities common in RL training loops.
- Objective: KTO's asymmetric loss, grounded in human psychology, may more directly shape model behavior to avoid negatives, whereas DPO/RLHF symmetrically maximize the likelihood of preferred outputs.
KTO vs. RLHF vs. DPO: A Comparison
A technical comparison of three leading algorithms for aligning language models with human preferences, focusing on their data requirements, training complexity, and practical trade-offs.
| Feature / Metric | Kahneman-Tversky Optimization (KTO) | Reinforcement Learning from Human Feedback (RLHF) | Direct Preference Optimization (DPO) |
|---|---|---|---|
Core Learning Signal | Binary desirable/undesirable label on a single output | Pairwise preference between two outputs | Pairwise preference between two outputs |
Required Data Format | Prompt + Output + Binary (Good/Bad) Label | Prompt + Chosen Output + Rejected Output | Prompt + Chosen Output + Rejected Output |
Training Pipeline Complexity | Single-stage fine-tuning | Three-stage pipeline (Reward Model training, RL fine-tuning) | Single-stage fine-tuning |
Explicit Reward Model | |||
Reinforcement Learning Loop | |||
Theoretical Basis | Prospect Theory (Loss Aversion) | Bradley-Terry Model + Reinforcement Learning | Bradley-Terry Model under a specific reward-policy link |
Primary Hyperparameters | Loss weight (λ), Reference model strength | Reward model architecture, KL penalty coefficient (β), PPO clip range (ε) | KL penalty coefficient (β) |
Typical Compute Cost | Low (comparable to SFT) | Very High (RM training + RL fine-tuning) | Medium (comparable to KTO, slightly higher) |
Stability & Tunability | High (simple classification-like loss) | Low (notoriously unstable RL tuning) | High (stable, resembles standard gradient descent) |
Risk of Reward Hacking | Low (no explicit reward to over-optimize) | High (agent can exploit imperfections in the learned RM) | Low (implicit reward is derived directly from policy) |
Handles Non-Comparable Outputs | |||
Directly Optimizes Policy Likelihood |
Example Applications of KTO
Kahneman-Tversky Optimization (KTO) is applied in scenarios where collecting binary feedback (good/bad) is more practical than pairwise comparisons. Its efficiency makes it suitable for continuous learning from user interactions.
Chatbot & Assistant Alignment
KTO is used to continuously align conversational AI with user expectations using simple thumbs-up/thumbs-down feedback.
- Binary Feedback Integration: Each user interaction provides a direct desirable/undesirable label, bypassing the need for complex preference rankings.
- Real-time Adaptation: Models can be updated incrementally based on streaming feedback, reducing the latency between user input and model improvement.
- Example: A customer service chatbot uses KTO to learn from post-conversation satisfaction scores, progressively reducing unhelpful or off-topic responses.
Content Moderation Systems
Moderation classifiers and flagging systems use KTO to learn from human reviewer decisions on single pieces of content.
- Learning from Verdicts: The model is trained on a dataset where each text or image example is labeled as either 'acceptable' or 'violation'.
- Handling Class Imbalance: The asymmetric KTO loss function can be weighted to prioritize reducing false negatives (missed violations) over false positives, aligning with safety-critical objectives.
- Efficiency Gain: This avoids the costly and often ambiguous task of having reviewers rank which of two harmful outputs is 'worse'.
Code Generation & Review
KTO optimizes code generation models based on whether a generated code snippet passes a set of unit tests or is accepted by a developer.
- Test-Based Feedback: A generated function is labeled desirable if it compiles and passes predefined tests; otherwise, it's undesirable.
- Developer-in-the-Loop: In an IDE plugin, a developer's explicit 'accept' or 'reject' of a code completion serves as the binary signal for KTO training.
- Outcome: The model learns to generate syntactically correct and functionally accurate code more reliably than from pre-training on static datasets alone.
Creative Tool Refinement
Tools for image generation, copywriting, or music composition use KTO to adapt to a user's or brand's specific style based on accept/reject actions.
- Personalization Loop: A user repeatedly generates outputs (e.g., ad copy variants) and selects the single best one for use. The chosen output is a desirable example; rejected generations from the same session can be treated as undesirable.
- Style Consistency: Over time, the model internalizes the binary feedback to produce outputs that align more closely with the user's implicit preferences without explicit style guides.
- Data Efficiency: This approach requires only a signal of what the user wants, not a detailed critique of why other options were worse.
Search & Recommendation Ranking
KTO can train ranking models by using a searcher's click or engagement with a single result as a positive signal, and lack of engagement or explicit 'not helpful' clicks as negative signals.
- Implicit Feedback Utilization: A click/query satisfaction signal provides a massive stream of naturally occurring binary preference data.
- Prospect Theory Alignment: The loss function's asymmetry can be tuned to reflect that a user's dissatisfaction with a bad result (a 'loss' relative to expectation) has a greater impact on perceived quality than the gain from a good result.
- Application: This is particularly useful for personalizing news feeds, product recommendations, or search engine result pages based on individual interaction histories.
Safety & Harmlessness Fine-Tuning
KTO provides a streamlined pipeline for training models to avoid harmful outputs by learning from binary 'safe'/'unsafe' labels.
- Constitutional AI Integration: A constitution-guided AI critic can label model outputs as 'harmless' or 'potentially harmful', creating a synthetic KTO dataset without human annotators (a form of RLAIF).
- Focus on Negatives: The framework naturally emphasizes reducing the probability of undesirable (harmful) outputs, which is a primary safety goal.
- Advantage over DPO/RLHF: It eliminates the need to construct preferred examples of harmful behavior for pairwise comparisons, which can be challenging and risky.
Frequently Asked Questions
Kahneman-Tversky Optimization (KTO) is a preference optimization algorithm based on prospect theory that uses binary desirable/undesirable feedback on single outputs, rather than pairwise comparisons. These FAQs address its core mechanisms, advantages, and practical applications.
Kahneman-Tversky Optimization (KTO) is a preference optimization algorithm that trains a language model using a loss function derived from prospect theory, requiring only binary feedback on whether a single output is desirable or undesirable. It works by framing the learning objective around the psychological concept of loss aversion, where the penalty for generating an undesirable output is weighted more heavily than the reward for a desirable one. The algorithm directly optimizes the model's policy to maximize the expected value function from prospect theory, eliminating the need for the traditional reward modeling and reinforcement learning steps found in RLHF. This is achieved by using a sigmoid function applied to the difference in log-likelihoods between the model's output and a reference output, scaled by a beta parameter that controls the strength of regularization.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Kahneman-Tversky Optimization (KTO) exists within a broader ecosystem of techniques for aligning AI models with human judgment. These related concepts form the technical vocabulary for training models using preferences rather than explicit labels.
Direct Preference Optimization (DPO)
Direct Preference Optimization (DPO) is a foundational algorithm for aligning language models that directly optimizes a policy using a binary cross-entropy loss on preference data, eliminating the need to train a separate reward model. It re-frames the RLHF objective into a simple supervised learning problem.
- Core Mechanism: Derives a closed-form mapping between the optimal policy and the reward function implied by the Bradley-Terry model.
- Key Advantage: More stable and computationally efficient than RLHF, as it avoids the complex reinforcement learning loop.
- Contrast with KTO: While DPO requires pairwise comparisons (chosen vs. rejected), KTO is designed for binary, absolute feedback on single outputs, making data collection simpler.
Reinforcement Learning from Human Feedback (RLHF)
Reinforcement Learning from Human Feedback (RLHF) is the canonical three-stage pipeline for aligning large language models with human preferences. It is the predecessor and broader framework within which algorithms like DPO and KTO were developed.
- Three-Stage Process: 1) Supervised Fine-Tuning (SFT), 2) Reward Model training on pairwise comparisons, 3) Policy optimization (e.g., with PPO) using the reward model.
- Complexity: Involves training multiple models (reward model, policy) and running a complex reinforcement learning optimization, which can be unstable.
- KTO's Role: KTO is proposed as a simpler, more robust alternative to the RLHF pipeline, especially when high-quality pairwise preference data is scarce.
Bradley-Terry Model
The Bradley-Terry model is a probabilistic model for the outcome of pairwise comparisons. It is the statistical backbone for most modern preference optimization algorithms, including DPO and the theoretical foundation KTO builds upon and modifies.
- Function: Estimates the probability that item A is preferred over item B as a function of their latent utility scores: P(A > B) = σ(score(A) - score(B)), where σ is the logistic function.
- Ubiquity: Forms the likelihood function for training reward models in RLHF and is implicitly used in DPO's derivation.
- KTO's Departure: KTO replaces the pairwise logistic loss derived from Bradley-Terry with a value function loss based on prospect theory, which is applied to absolute desirability labels.
Reward Modeling
Reward modeling is the process of training a neural network to predict a scalar reward that reflects human preferences, typically learned from datasets of pairwise comparisons. It is a critical but vulnerable component of the RLHF pipeline.
- Purpose: To create a proxy objective function that can be optimized at scale via reinforcement learning.
- Challenges: Prone to reward hacking and reward overoptimization, where the policy exploits flaws in the reward model.
- KTO's Approach: KTO bypasses explicit reward modeling entirely. It directly optimizes the policy using a loss function that implicitly encodes a human-like utility function, reducing the risk of overoptimization on a flawed proxy.
Prospect Theory
Prospect Theory, developed by Daniel Kahneman and Amos Tversky, is a behavioral economic theory that describes how people make decisions involving risk and uncertainty. It posits that people value gains and losses relative to a reference point and are loss-averse.
- Key Principles: Loss Aversion (losses hurt more than equivalent gains please), Diminishing Sensitivity, and Probability Weighting.
- AI Relevance: KTO directly incorporates a value function from prospect theory into its loss function. The KTO loss treats desirable and undesirable outputs asymmetrically, heavily penalizing the generation of undesirable outputs to reflect human loss aversion.
- Differentiator: This psychological grounding is what distinguishes KTO from other preference optimization methods that rely on standard statistical models like Bradley-Terry.
Binary Feedback & Absolute Labels
Binary feedback refers to simple, absolute judgments on a single item (e.g., "good" or "bad"), as opposed to relative preferences between pairs. KTO is specifically engineered for this simpler, often more abundant, form of data.
- Data Efficiency: Easier and cheaper to collect at scale than consistent pairwise comparisons. Annotators only need to evaluate one output at a time.
- Real-World Fit: Mirrors many natural feedback mechanisms (e.g., thumbs up/down, star ratings, error flags).
- Technical Challenge: Standard preference optimization algorithms like DPO cannot use this data directly. KTO's core innovation is a loss function that effectively utilizes these absolute labels by framing them as gains or losses relative to a latent reference point.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us