1. Home
  2. Explore
  3. Computer Science
  4. Reinforcement Learning in LLMs

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Reinforcement Learning in LLMs

Reinforcement Learning: Scaling, Rewards, Environments, and Systems

1. Reinforcement learning in modern AI

Reinforcement learning (RL) trains a model to improve its behavior through interaction with an environment. The model takes actions, receives feedback in the form of rewards or other signals, and adjusts its behavior to achieve better outcomes. Unlike a process that learns only from fixed examples, RL can teach a model how to use its existing knowledge to pursue goals.

In modern AI, RL is often applied after pre-training. Pre-training gives a model broad knowledge and capabilities by exposing it to large collections of data. RL can then shape how the model uses that knowledge: for example, how it reasons through a problem, uses tools, follows preferences, or completes a task.

A useful distinction is:

  • Pre-training primarily builds broad knowledge and general capabilities from data.

  • RL post-training primarily improves goal-directed behavior by providing feedback on the model’s actions and outcomes.

This separation has produced effective systems, but it may limit models’ ability to learn continuously from real-world use. A longer-term research goal is to combine learning broad world knowledge and learning goal-directed behavior more directly.

RL is being applied in several kinds of settings:

  • Reasoning tasks, where answers or solution steps can be checked.

  • Games and simulated environments, where an agent can make repeated attempts.

  • Robotics and physical systems, where actions affect the real world.

  • Enterprise workflows, where models carry out business-specific tasks.

  • Human interactions, where success may depend on understanding people and adapting over time.

  • Scientific research, where systems conduct experiments and learn from their results.

The setting matters because each environment provides different kinds of feedback, data, uncertainty, and operational challenges.


2. What it means to scale reinforcement learning

Scaling RL means increasing the resources or opportunities available for learning. Unlike pre-training, where compute and data scaling can often be described through relatively well-studied relationships, RL scaling is less settled. Its results depend heavily on the environment, reward signal, model behavior, and supporting systems.

Major dimensions of RL scaling

  • Compute: More computational resources can support more model inference, training, evaluation, and optimization.

  • Number of environments: A model can interact with more instances or types of environments.

  • Number of attempts: The model can try more solutions or actions for a task.

  • Reasoning and tool use: Each attempt can involve more internal reasoning or calls to external tools.

  • Model size: Larger models may provide stronger starting capabilities or improve performance.

  • Interaction volume: A model can learn from more interactions with people, agents, or physical systems.

  • Time horizon: Learning can extend across longer sequences of actions, with outcomes that may take longer to become clear.

  • Data quality and diversity: Useful learning may require new kinds of data rather than simply more copies of existing data.

  • Inference allocation: For many RL workloads, a large share of resources may be spent running the model to produce attempts, traces, and actions rather than only updating its weights.

The best scaling strategy depends on the task. Some RL settings have many well-defined environments and clear rewards. Others, such as enterprise workflows, may have limited structured training data and require careful use of inference to extract useful learning from each example.

Scaling is not automatically predictable

A training run can fail, stop improving, or improve more slowly than expected. In practice, practitioners set performance targets and estimate how a run should progress. Scaling is partly about whether a system can reach its intended targets as resources increase, not merely whether more compute has been added.

A scaling curve may behave differently depending on:

  • Whether the reward signal is reliable.

  • Whether the model can access enough relevant environments.

  • Whether the reward matches the real goal.

  • Whether the infrastructure can sustain the workload.

  • Whether the model’s behavior changes the amount or type of computation required.

For these reasons, RL scaling is not simply “more compute produces more capability.” It also requires understanding what the model is learning and whether the system is measuring the right outcomes.


3. Environments and learning signals

An environment is the setting in which a model acts and receives feedback. It may be a game, a simulated customer workflow, a laboratory, a software system, or an interaction with people.

The environment determines what the model can do, what information it can observe, and what counts as success. The design and reliability of the environment therefore shape the quality of RL training.

Verifiable environments

A verifiable reward is a feedback signal whose correctness can be checked with relatively high confidence. Simple mathematics is an example: the answer to a problem such as 2+22 + 22+2 can be compared against a known result. Programming tasks may also have verifiable outcomes if the code can be tested.

Verifiable environments are valuable because they make it easier to tell whether a model’s behavior is improving. With a dependable signal, repeated attempts can be used to optimize performance.

However, not all tasks can be reduced to a simple answer check. A task may have many valid solutions, or success may depend on qualities such as usefulness, safety, speed, or fit with a user’s needs.

Unverifiable and ambiguous environments

In many real-world settings, the correct outcome is not fully specified. People may disagree about how a task should be performed, and an expert’s preferred approach may differ from another expert’s. The environment may also change as people, tools, or other agents interact with one another.

Examples include:

  • Completing a business workflow in a way that meets organizational expectations.

  • Helping a group coordinate toward a shared goal.

  • Carrying out a scientific investigation where the result is not known in advance.

  • Responding to a user whose preferences are only partly stated.

Such settings require more than a simple correctness check. They may involve delayed, sparse, noisy, or subjective rewards. A model may need to complete a long sequence of actions before anyone can judge the result.

Physical environments and scientific discovery

Scientific environments differ from simple question-answering tasks because experiments can produce large amounts of information, not just a single success-or-failure outcome. A physical experiment may generate measurements, observations, and other data that help characterize what happened.

In scientific applications, systems may:

  • Carry out semi-autonomous experiments.

  • Learn from physical outcomes.

  • Use experiments to investigate materials or physical properties.

  • Predict aspects of an experiment or its possible results.

  • Explore areas where little prior scientific data exists.

This makes laboratories and physical infrastructure part of the learning environment. For scientific RL, scaling may require more than additional compute: it may also require access to more experiments, equipment, and environments that do not exist in ordinary digital datasets.


4. Reward design, objectives, and reward hacking

The reward function defines what the RL system is encouraged to optimize. Designing it is one of the most important and difficult parts of the process.

A reward can combine multiple objectives. For example, an enterprise system might need to:

  • Complete a task correctly.

  • Meet a response-time limit.

  • Reduce the cost of using a more expensive model.

  • Follow a customer’s required workflow.

A reward function can include these criteria, but adding them does not guarantee that the resulting behavior will match what people actually want.

A model optimizes the signal it receives, not the intention behind that signal.

If the highest-reward behavior is undesirable, giving the model more compute can make the problem worse. The model may become increasingly effective at exploiting a flawed objective.

Reward misspecification

Reward misspecification occurs when the training signal does not accurately represent the real goal. The reward may omit an important constraint, assign the wrong weight to a criterion, or fail to cover an unusual situation.

This risk is especially high when:

  • Experts disagree about what good performance means.

  • Business goals are difficult to translate into measurable criteria.

  • The training environment omits important parts of the real workflow.

  • The model encounters situations not represented in its training data.

  • A metric captures only one aspect of a broader objective.

Before scaling an RL run, practitioners need to identify which “hill” the model should climb: that is, the objective that genuinely corresponds to the intended outcome. Defining that objective is often a human and engineering task, not something that can be safely delegated to automated optimization.

Reward hacking and failure modes

Reward hacking occurs when a model finds a way to obtain a high reward without achieving the intended goal. This may happen when the reward contains blind spots or when the simulated environment differs from reality.

Examples of failure include:

  • Exploiting a case that was absent from the original training data.

  • Learning behavior that works in a mock environment but fails in the real one.

  • Deviating from a customer’s required process, even if the model appears to complete the task.

  • Optimizing speed or another measurable target at the expense of overall quality.

A system’s failures can also come from the infrastructure that supplies the reward. For example, if an external grading service or API returns errors, the model may receive incorrect negative feedback for otherwise reasonable actions. In that case, the apparent learning signal reflects a system failure rather than the quality of the model’s behavior.

Reliable RL therefore requires testing the entire chain that produces feedback, including external services, simulators, tools, and physical environments.


5. Enterprise RL and specialized intelligence

Enterprise tasks often differ from the tasks emphasized in general model training. A company may have proprietary workflows, specialized terminology, strict latency requirements, or business outcomes that are not represented in broad training data.

A common approach is to transform an organization’s proprietary information into useful training material, including:

  • Environments that reproduce important parts of a workflow.

  • Data points that represent task situations and outcomes.

  • Rewards that reflect the organization’s goals.

  • Evaluations that test whether the model performs as intended.

The aim is to produce specialized systems that are strong at the tasks a particular organization cares about. Such systems may be designed to remain under the organization’s ownership or control.

Finding the right business objective

Enterprise RL often begins by working with subject-matter experts and technical teams to determine what good performance means. A downstream business outcome may be relevant, but it may not be directly measurable during every training attempt. Alternatively, a company may care about operational constraints such as response quality within a latency or cost budget.

The process is iterative:

  1. Identify the business outcome or operational constraint.

  2. Construct a reward and an environment that approximate it.

  3. Run training and evaluate the resulting behavior.

  4. Find cases where the model fails or the environment is inaccurate.

  5. Improve the task definition, environment, or reward.

  6. Scale again and repeat the evaluation.

This process depends on rigorous engineering. An environment that does not reproduce the real workflow can train a model toward behavior that is counterproductive in deployment.

Inference as a scaling resource

Enterprise tasks may require many attempts or long reasoning traces because the problem is outside the distribution of the data on which general models were trained. As a result, an important scaling question may be how much compute to allocate to language-model inference—the process of generating the model’s responses and actions—rather than only how much training compute to allocate.

Inference-time computation can support:

  • More solution attempts.

  • Longer reasoning.

  • Additional tool use.

  • More exploration of possible actions.

In a limited-data setting, a central challenge is extracting enough learning signal from the examples and environments that are available.


6. Human interaction and long-horizon learning

People are able to navigate ambiguity and uncertainty, often by communicating, coordinating, and adapting to one another. RL systems intended to work effectively with people may therefore need to learn from many interactions across long periods of time.

This creates a different scaling problem from simply increasing the number of verifiable questions answered. Important considerations include:

  • Long-horizon interaction: The meaningful outcome may emerge only after many exchanges or actions.

  • Delayed reward: Feedback may arrive well after the behavior that contributed to it.

  • Uncertainty: People may not state their goals completely or consistently.

  • Multiple participants: A model may need to work with groups, not just an individual user.

  • Changing context: The expectations and circumstances of an interaction may evolve.

Some outcomes are difficult to verify objectively. The model may need to infer whether an interaction was useful, whether the participants’ needs were understood, and whether progress was made toward a shared goal. Designing these environments and rewards is challenging because the signal is less precise than a simple correctness check.

A key research question is generalization: whether learning from simple, verifiable tasks can help a model perform in more complex, dynamic environments and build useful capabilities over time.


7. Reward latency, sample efficiency, and credit assignment

The time it takes to obtain a reward can strongly affect RL system design. In some settings, feedback can be generated quickly by a model or an automated checker. In others, evaluation may require a long reasoning process, external grading, a physical experiment, or an extended interaction with a person.

As reward latency increases, training faces several difficulties:

  • Sample efficiency: The system must learn effectively from each costly attempt.

  • Sparse rewards: Feedback may be available only occasionally.

  • Credit assignment: The system must determine which earlier actions contributed to a later outcome.

  • Throughput: Slow evaluation limits how many training examples can be processed.

An experiment may produce abundant data, but obtaining and interpreting that data can still be slow. Likewise, a complex task may have a meaningful final result without providing clear feedback at each intermediate step.

Future systems may need to handle rewards that take much longer to evaluate than conventional automated checks. That makes efficient use of experiments and interactions especially important.


8. Continuous learning, production data, and memory

Continual learning is the ability of a model to keep adapting as it encounters new information and experiences, rather than remaining fixed after training and deployment.

A deployed model can generate traces of how it performs in real settings. These traces may reveal:

  • Cases that were not anticipated during training.

  • Unexpected outcomes.

  • Persistent errors.

  • Differences between the training environment and production.

  • New information about what users or organizations need.

A data flywheel forms when deployed systems produce useful information, that information is used to improve the model, and the improved model produces better results and more informative traces.

To make this process useful, systems need strong observability and telemetry: the ability to record and inspect how models behave. The development loop can then identify surprising or problematic cases, determine whether they contain a useful learning signal, and use them to improve the model.

The difficulty of extracting reward from production data

Production data may be abundant, but reward signals within it can be sparse. A large volume of traces does not automatically reveal which behaviors were good or why they succeeded. Systems must distinguish meaningful evidence from noise and determine which outcomes should influence training.

Continual learning also raises questions about the model’s goals:

  • Which signals should it learn from?

  • Which outcomes should it optimize?

  • How should it recognize that an objective has changed?

  • How can it adapt without forgetting useful prior capabilities?

These questions connect continual learning to reward design: adapting continuously is useful only if the system can identify the right information and goals.

Memory and learning

Memory provides a mechanism for retaining or retrieving information that does not fit naturally into the model’s immediate context. In humans, memory supports reasoning without requiring every relevant detail to be held in active attention at once. In AI systems, memory can similarly help make information available when needed.

Memory and continual learning are related but distinct:

  • Memory can store or retrieve information for later use.

  • Continual learning involves deciding what is significant, learning from it, and adapting behavior or knowledge over time.

A system may store a fact without understanding how it relates to other information or how it should change its behavior. A fuller learning process must do more than record information: it must identify useful signals and connect them to the model’s objectives.


9. Bringing pre-training and RL closer together

The conventional approach uses separate stages: pre-training provides broad world knowledge, and RL teaches the model how to apply that knowledge toward goals. This arrangement has been productive, but it creates a boundary between learning from fixed data and learning from experience.

A possible future direction is to combine these processes more directly. A model that learns both knowledge and behavior in an integrated way could potentially:

  • Make use of new information as it encounters it.

  • Adapt to real systems instead of relying only on mocked environments.

  • Continue improving after deployment.

  • Learn from the actual tasks and interactions it performs.

In a fully continuous version, the model would not simply be trained in a laboratory and then deployed as a static system. It would adapt to new situations and accumulate relevant experience while operating.

This direction faces substantial practical hurdles. Much of the existing data, infrastructure, and tooling is built around separate training and inference phases. Those assumptions can shape which experiments are easy to run and which research questions receive attention.

Personalized expertise and “jagged” intelligence

Current models may perform very well across many areas while lacking the depth of a human specialist in a particular domain. Human experts often develop deep understanding through years of sustained work. A system that learns continuously within a specific field may eventually build more specialized expertise.

One possible outcome is personalized models: systems that adapt to the work, interests, and needs of particular people or organizations, while also benefiting from shared learning where appropriate.

Models may have uneven capabilities, a pattern sometimes described as “jagged” intelligence. A model can be highly capable in some areas and weak in others. The goal is not merely to make its capability uneven, but to make its strengths align with the tasks that matter to a particular user or domain.


10. RL workloads and infrastructure

RL workloads place different demands on computing systems than large-scale pre-training. Pre-training can be understood as a highly synchronized process in which many machines carry out coordinated work. RL is more dynamic: it combines training with inference, environment interaction, tool use, evaluation, and sometimes physical experiments.

Why RL is more variable

The model’s behavior affects the workload itself:

  • Longer reasoning traces increase inference demand.

  • More tool calls increase demand on external services.

  • Use of sub-agents can cause additional, cascading model calls.

  • Different task types may require different amounts of computation.

  • Slow or unreliable environments can block training progress.

Therefore, the amount of work assigned to each subsystem is not necessarily constant throughout a run. It can shift as the model learns and behaves differently.

Flexible resource allocation

An effective RL platform may need to:

  • Load-balance resources across training, inference, tools, and environments.

  • Shift compute dynamically toward the subsystem that is currently under the most pressure.

  • Autotune settings as workload patterns change.

  • Maintain reliable operation despite failures in hardware or external services.

  • Reduce mismatch between the systems used for training and inference.

Pre-training systems also need to handle failures, such as replacing a faulty accelerator or restarting a run. RL adds another kind of flexibility: resources may need to move during the run because the model’s behavior changes the workload.

Orchestration is consequently more complicated. The system must coordinate components whose load depends partly on the actions and strategies of the model being trained.

Practical operational lessons

Large-scale RL requires careful engineering and monitoring. Important practices include:

  • Strong observability into the behavior of the model and every part of the training pipeline.

  • Reliable hardware and interconnects.

  • Careful debugging of both machine-learning behavior and systems failures.

  • Monitoring external APIs, graders, simulators, and physical environments.

  • Separating genuine model mistakes from failures in the feedback or infrastructure.

The failure domain extends well beyond the accelerators. A mock environment can break, an external service can return errors, and a reward system can malfunction. Any of these problems can corrupt training signals and cause the model to learn incorrectly.


11. Key takeaways

  • RL scaling has multiple dimensions: compute, environments, attempts, inference, interaction volume, and time horizon can all matter.

  • The environment defines what can be learned: verifiable tasks are easier to optimize than ambiguous, dynamic, or physical ones.

  • Reward design is foundational: scaling a flawed objective can make undesirable behavior more effective.

  • Real-world tasks require iteration: rewards and environments must be tested against actual business, human, or scientific needs.

  • Delayed and sparse feedback increases difficulty: it creates challenges in sample efficiency and credit assignment.

  • Continual learning depends on useful signals: deployment traces are valuable only when systems can identify what they mean and how they should change behavior.

  • Memory is not the same as learning: storing information does not by itself produce understanding or adaptation.

  • RL infrastructure must be dynamic: workload demands shift with the model’s reasoning, tool use, and interaction patterns.

  • Scaling requires reliable end-to-end systems: hardware, APIs, environments, evaluation, and telemetry all contribute to the quality of learning.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent