liveBook · Manning

Reinforcement learning

As explained in Introduction to Generative AI, Second Edition

Reinforcement learning is machine learning in which an agent learns behavior from rewards or penalties produced by interactions with an environment.

Reinforcement learning is machine learning by trial and error. An agent interacts with an environment, receives rewards or penalties, and gradually favors behaviors associated with better results. section 1.1

It differs from other learning paradigms in what guides improvement:

  • Supervised learning maps labeled inputs to known outputs. section 1.1
  • Unsupervised learning discovers patterns without labels or a specific reward. section 1.1

A reward is numerical feedback representing progress toward a task. Positive feedback makes rewarded behavior more likely to recur, while penalties make the associated behavior less likely. The approach is useful when a system can evaluate results, but desirable behavior is not always easy to define. section 1.1 section 2.10

Reinforcement learning from human feedback

For large language models, people evaluate responses as acceptable, problematic, or preferable. Those judgments estimate a reward function, allowing later responses to improve according to aggregated human preferences. This method, called reinforcement learning from human feedback (RLHF), helps guide behavior when no simple automatic reward function exists. section 2.10

How Introduction to Generative AI, Second Edition covers it

How deep it goes
Defines rewards, penalties, and comparison paradigms at an intuitive level, but stops short of algorithmic or implementation detail.
Examples
Uses model outputs, numerical rewards and penalties, and human-ranked responses as teaching examples.
What it assumes
Assumes no prior learning framework, introducing supervised, unsupervised, and reinforcement learning together.
What you can do after
Evaluate/understand how feedback shapes model behavior and why human preferences can guide language-model responses.
How it connects
Connects reinforcement learning with supervised learning, unsupervised learning, reward functions, human feedback, and large language models.

Also explained in

Compare how 18 books explain reinforcement learning →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Introduction to Generative AI, Second Edition. The section links point to the parts of the book it draws on.