Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Hugging Face 7 min read Deep dive mediumAdept

Advantage Actor Critic (A2C)

Actor-Critic methods reduce the high variance of Monte-Carlo policy-gradient estimates in Reinforce by pairing a policy network (Actor) with a value network (Critic) that scores the actions taken. A2C stabilizes training further by using the advantage function, which measures how much better an action is than the state's average value. The TD error serves as a practical estimator, so separate Q and V networks aren't needed. The unit closes with a Colab exercise training bipedal and spider walkers in PyBullet with Stable-Baselines3.

Assumes: policy gradient methodsReinforce algorithmvalue functions and Q-valuesTD learning

Related posts

  • Policy Gradient with PyTorch

    Hugging Face easyNovice

    Policy-gradient methods optimize a stochastic policy directly via gradient ascent on expected return, instead of deriving a policy from learned Q-values as in Deep Q-Learning. Their advantages are built-in exploration, robustness to perceptual aliasing, and handling of continuous or high-dimensional action spaces. Their drawbacks are convergence to local maxima, slow training and high variance. Reinforce (Monte Carlo Policy Gradient) collects a full episode, estimates the gradient from the log-probabilities of the actions weighted by the return, and updates the weights. A linked Colab notebook implements it in PyTorch on CartPole-v1, PixelCopter and Pong.

  • An Introduction to Deep Reinforcement Learning

    Hugging Face easyNovice

    Deep reinforcement learning trains an agent to act in an environment through trial and error, using rewards as its only feedback, with the goal of maximizing expected cumulative (discounted) return. The core concepts are the state/action/reward loop, the Markov property, observation vs. state, discrete vs. continuous action spaces, discounting with gamma (typically 0.95–0.99), episodic vs. continuing tasks, and the exploration/exploitation tradeoff. The two main ways to learn an optimal policy are policy-based methods, which map states directly to actions or action distributions, and value-based methods, which learn state values and act greedily toward them. It is the first unit of Hugging Face's free Deep RL course, which goes on to train a lunar lander agent with Stable Baselines3.

  • Thinking of ACE? We Can Do It with Fewer Tokens

    Hugging Face hardMaster

    ALTK-Evolve and ACE both turn an LLM agent's past trajectories into reusable lessons without weight updates. Both avoid compressing those lessons into short summaries. They differ in delivery. ACE injects its full evolving playbook on every step. ALTK-Evolve consolidates support-counted, typed guidelines and sends either a high-support core plus task-selected guidelines or the full set, depending on model capability. On AppWorld with the same ReAct agent, ALTK-Evolve reaches 89.3 vs 80.4 TGC on DeepSeek-V3.2 at about 40% of ACE's tokens (263K vs 634K per task). On gpt-oss-120b it roughly ties on accuracy at about one-seventh the cost, and selective retrieval wins mainly on hard tasks.

  • Turning Database Grading into RL Rewards: Post-Training Agents with ThinkingBox

    Hugging Face hardMaster

    Executable checks on terminal database state, originally built to grade agents in ThinkingBox-Bench, double as binary RL rewards for post-training tool-using agents. Fine-tuning Qwen3.8-27B with token-mean GRPO for 50 steps on 187 out-of-distribution tasks raised pass@1 from 51.70% to 60.78% and tasks solved on all 20 attempts from 38 to 107, while pass@20 coverage dipped slightly, consistent with sharpening. The key lever is offline policy-relative difficulty: candidate tasks are probed against the base policy, a Jeffreys Beta posterior estimates success probability, and only tasks likely to yield mixed reward groups (non-zero GRPO advantage) are kept. Cost per dependable task fell from $24.36 to $8.00, approaching frontier models.

  • An Introduction to Q-Learning Part 1

    Hugging Face mediumAdept

    Value-based reinforcement learning methods learn a state-value or action-value function and derive the policy from it, typically a greedy or epsilon-greedy policy, rather than training the policy directly. The Bellman equation makes value estimation recursive: a state's value is the immediate reward plus the discounted value of the next state. Monte Carlo methods update values only after a full episode using the actual return, while Temporal Difference learning (TD(0)) updates after each step by bootstrapping from the current estimate of the next state. Worked numeric examples with a mouse-and-cheese grid show both update rules, setting up Q-Learning in the next part.

The quest for software engineering knowledge.

Look:
Layout: