techlist.io

OpenAI

274 posts

openai.com/news

Filter by tag

OpenAI2017-07-263 min readCurated summary

Better exploration with parameter noise

# Better Exploration with Parameter Noise Adding adaptive noise to the parameters of reinforcement learning policies, rather than to their actions, often improves performance. The method is simple to implement, rarely hurts results, and lets agents learn tasks much faster. On the HalfCheetah environment, a policy trained with parameter noise reached a score of about 3,000 after 20 episodes, while one trained with traditional action noise reached about 1,500. ## How Parameter Noise Differs from Action Noise - Traditional reinforcement learning explores by adding noise to the action space, which changes the probabilities of actions from one moment to the next. - Parameter noise instead perturbs the weights of the neural network policy, so the agent's decisions still depend fully on what it currently senses. - The approach sits between evolution strategies, which perturb parameters but not actions during rollouts, and methods like TRPO, DQN, and DDPG, which perturb actions but leave parameters untouched. - The authors believe the advantage comes from consistency: deliberate parameter perturbations produce exploration that persists across timesteps, while action noise produces erratic exploration unrelated to the agent's parameters. - Earlier work applied parameter noise to policy gradients, but this research extends it to deep neural network policies and to both on-policy and off-policy algorithms. ## Solving the Three Main Challenges - **Varying layer sensitivity:** Different layers respond differently to perturbations. Layer normalization keeps each perturbed layer's output within a similar distribution, so the next layer receives stable inputs. - **Shifting sensitivity over training:** The weights' sensitivity changes as training progresses, making behavior hard to predict. An adaptive scheme resizes the perturbations by measuring their effect on actions and comparing the resulting action-space noise level to a target. - **Choosing the noise scale:** Parameter noise is hard to interpret intuitively. The adaptive scheme moves the scale decision into action space, which is easier to reason about. ## Baselines and Benchmarks - The release includes baseline code for DQN, Double DQN, Dueling DQN, Dueling Double DQN, and DDPG with parameter noise. - Benchmarks compare DDQN with and without parameter noise on a subset of Atari games. - Benchmarks also compare three DDPG variants on a range of continuous control tasks in the MuJoCo simulator. ## Development Lessons - In early experiments, perturbing the DQN Q-function sometimes was so extreme that the agent repeated the same action. The team added a separate explicit policy head, as in DDPG, to work around this. - Later experiments showed the policy head was unnecessary. Changing how the noise was rescaled had likely fixed the underlying problem, so the simpler version performed comparably. - The authors note that reinforcement learning algorithms can fail silently and subtly, which can lead engineers to build workarounds around bugs they never noticed. ## Practical Takeaway Parameter noise is worth trying on any reinforcement learning problem. It is simple to add, rarely reduces performance, and can speed up learning considerably, especially when paired with layer normalization and adaptive scaling.

OpenAI2017-07-193 min readCurated summary

Proximal Policy Optimization

# Proximal Policy Optimization: A Simpler, Robust Policy Gradient Method OpenAI introduces Proximal Policy Optimization (PPO), a new family of reinforcement learning algorithms that matches or beats state-of-the-art methods while being far simpler to implement and tune. The post argues that PPO strikes a practical balance between ease of implementation, sample efficiency, and ease of tuning, and reports that it has become OpenAI's default RL algorithm as a result. ## The Problems with Policy Gradient Methods - Policy gradient methods underpin many deep RL successes, including video games, 3D locomotion, and Go. - They are highly sensitive to the step size: too small and learning is painfully slow, too large and noise overwhelms the signal or performance collapses. - They often have poor sample efficiency, needing millions or billions of timesteps to learn simple tasks. ## Earlier Fixes: TRPO and ACER - TRPO and ACER constrain or otherwise optimize the size of each policy update to address these issues. - ACER is considerably more complex than PPO, requiring off-policy corrections and a replay buffer, while only marginally outperforming PPO on Atari. - TRPO works well for continuous control but is hard to combine with architectures that share parameters between the policy and value function, or that use auxiliary losses, which are common in vision-heavy domains like Atari. ## The PPO Objective - Supervised learning is predictable, whereas RL algorithms have many interacting parts that are hard to debug and require heavy tuning. - PPO computes each update to minimize the cost function while keeping the new policy close to the previous one. - An earlier PPO variant used an adaptive KL penalty to control policy change. The new version replaces this with a clipped surrogate objective built from the probability ratio between the new and old policies, multiplied by the estimated advantage, with a clipping hyperparameter ε typically set to 0.1 or 0.2. - This objective approximates a trust region update while remaining compatible with stochastic gradient descent. It removes the KL penalty and the need for adaptive update schedules. - In tests, PPO performed best on continuous control tasks and nearly matched ACER on Atari. ## Demonstration: Controllable Robots - Interactive agents trained with PPO were shown in Roboschool, where a user set new target positions for a robot via keyboard. - Although the input sequences differed from the training distribution, the agent generalized to them. ## Released Implementations - OpenAI Baselines now includes scalable, parallel implementations of PPO and TRPO that use MPI for data passing, written in Python 3 and TensorFlow. - Pre-trained policies for the robots are available in the Roboschool agent zoo. - A later update added PPO2, a GPU-enabled implementation that runs about 3x faster than the original PPO baseline on Atari. - The update also added ACER, which uses a replay buffer to perform multiple gradient updates per sample and a Q-function approximator trained with the Retrace algorithm. ## Conclusion PPO offers a practical default for policy gradient reinforcement learning: it is simpler than TRPO and ACER, performs comparably or better across continuous control and Atari, and is easier to tune. Its open-source implementations in Baselines make it straightforward to adopt.

OpenAI2017-07-162 min readCurated summary

Robust adversarial inputs

Researchers have created adversarial images that stay effective across different scales and viewing perspectives, which challenges the view that self-driving cars would be hard to fool because they capture images from many angles. Standard adversarial examples break under small image transformations, but the authors show that deliberately optimizing against a range of transformations produces perturbations that remain adversarial. The result is a single image that fools a neural network classifier under scaling, rotation, translation, noise, and other changes. ## Why Standard Adversarial Examples Are Fragile - Ordinary adversarial examples, created with projected gradient descent, fail under simple image transformations. - In the post's demo, a cat image perturbed to be classified as a "desktop computer" by Inception v3 (trained on ImageNet) was correctly relabeled as a "tabby cat" after a zoom of just 1.002. - The authors suspected that adversarial examples could be made robust with deliberate effort, since prior work showed they can transfer to the physical world. ## Scale-invariant Adversarial Examples - Instead of optimizing against one fixed view, the method optimizes over an ensemble of stochastic classifiers that randomly rescale the input before classifying it. - This produces perturbations that are adversarial across scales. - Even when only the pixels belonging to the cat are modified, a single perturbed image can be adversarial at all desired scales at once. ## Transformation-invariant Adversarial Examples - The same technique is extended by adding random rotations, translations, scaling, noise, and mean shifts during optimization. - The resulting single input remains adversarial under any of these transformations. - Transformations are sampled randomly at test time, which shows the example is robust across the whole distribution of transformations, not just a few cherry-picked ones. ## Implications The findings suggest that vision systems relying on multiple viewpoints are not automatically protected against adversarial attacks, since an attacker can deliberately optimize an input to survive those variations.

OpenAI2017-07-042 min readCurated summary

Hindsight Experience Replay

The paper introduces Hindsight Experience Replay (HER), a technique that lets reinforcement learning agents learn efficiently from sparse, binary rewards without hand-engineered reward functions. HER works with any off-policy RL algorithm and acts as a form of implicit curriculum. The authors test it on robotic arm manipulation and show that policies trained in simulation can complete the same tasks on a physical robot. ## The Sparse Reward Problem - Sparse rewards are one of the main obstacles in reinforcement learning, since an agent receives little useful feedback until it succeeds. - The usual workaround is reward engineering, which is labor-intensive and can distort the learned behavior. - HER is designed to avoid this by making binary success or failure signals sufficient for learning. ## Hindsight Experience Replay - HER is a replay-based method that can be combined with an arbitrary off-policy RL algorithm. - It enables sample-efficient learning from binary rewards, which indicate only whether the task was completed. - The authors describe it as an implicit curriculum, meaning it structures the learning process without requiring an explicit sequence of progressively harder tasks. ## Robotic Manipulation Experiments - The method is evaluated on three object-manipulation tasks with a robotic arm: pushing, sliding, and pick-and-place. - In every task, the only reward signal is whether the task was completed. - Ablation studies show that HER is essential, since training in these challenging environments is not feasible without it. ## Transfer to a Physical Robot - Policies trained in a physics simulation are deployed on a real robot. - The physical robot successfully completes the tasks, which indicates that the learned policies transfer from simulation to reality. Where reward design is hard or success is easy to define but hard to shape, HER offers a way to train with simple binary success signals and avoid elaborate reward engineering.

OpenAI2017-06-302 min readCurated summary

Teacher–student curriculum learning

This post introduces Teacher–Student Curriculum Learning (TSCL), a framework in which a Student agent learns a complex task while a Teacher agent automatically selects subtasks for it to practice. The authors show that TSCL matches or beats carefully hand-designed curricula in two domains: decimal addition with LSTMs and navigation in Minecraft. In the Minecraft maze, the automatically generated curriculum solved a task that could not be learned by training directly on it, and it learned an order of magnitude faster than uniform sampling of subtasks. ## Framework Structure - The Student attempts the full complex task. - The Teacher chooses subtasks from a predefined set to train the Student on. - The approach falls under automatic curriculum learning, under the broader heading of learning paradigms. ## Teacher Algorithms - The core intuition is that the Student should practice most on the subtasks where it improves fastest, meaning where the slope of its learning curve is steepest. - The Teacher also addresses catastrophic forgetting by selecting subtasks where the Student's performance is declining, so previously learned skills are revisited. - The authors describe a family of such Teacher algorithms rather than a single method. ## Experimental Results - **Decimal addition with LSTMs:** TSCL performs on par with or better than manually designed curricula. - **Minecraft navigation:** TSCL solves a maze that direct training fails to solve at all, and it reaches competence about ten times faster than uniform subtask sampling.

OpenAI2017-06-272 min readCurated summary

Faster physics in Python

# Faster Physics in Python: Open-Sourcing mujoco-py 1.50 OpenAI released a major version of mujoco-py, its Python 3 bindings for the MuJoCo physics engine, to support its deep learning robotics research. The release adds efficient parallel simulation, GPU-accelerated headless rendering, direct access to MuJoCo's internals, and support for MuJoCo 1.50 features such as its improved contact solver. Together these changes make batched simulation several times faster and let robotics teams generate large volumes of synthetic training data. ## Batched Simulation with MjSimPool - Trajectory optimization and reinforcement learning methods such as LQR, PI2, and TRPO benefit from running many simulations at once. - mujoco-py uses OpenMP for data parallelism, and Cython and NumPy for direct-access memory management. - Naive use of the new MjSimPool interface is about 400% faster than the previous version. - It is still about 180% faster than an optimized multiprocessing setup achieving the same parallelism. - Most of the gain comes from reduced access times to MuJoCo data structures. ## GPU-Accelerated Texture Randomization - OpenAI uses domain randomization across many projects, and headless GPU rendering provides about a 40x speedup over CPU rendering. - This yields hundreds of synthetic frames per second. - Randomizing a robot's textures during training helps it recognize its own body when transferring from simulation to the real world. ## Virtual Reality Support - The API is sufficient for VR interaction without additional C++ code. - The team ported MuJoCo's C++ VR example to Python using mujoco-py. - The example works with an HTC Vive setup. The support is experimental but has been used internally for some time. ## API and Usage - The `MjSim` class is the simplest entry point. It wraps the model and data, steps the simulation, and renders camera sensor images. - Models are loaded with `load_model_from_path`, and state is read through attributes such as `sim.data.qpos`. - Advanced users can access the MuJoCo C structs and functions directly. The README and full documentation cover these interfaces. ## Conclusion For teams running large-scale robotics simulation or training with synthetic data, mujoco-py 1.50 offers substantial performance gains. MjSimPool is the recommended starting point for batched workloads, and the included examples (`simpool.py`, `disco_fetch.py`) show how to use it.

OpenAI2017-06-073 min readCurated summary

Learning to cooperate, compete, and communicate

# Multi-Agent Reinforcement Learning with MADDPG OpenAI's MADDPG (Multi-Agent Deep Deterministic Policy Gradient) is a reinforcement learning algorithm for training multiple agents that must cooperate or compete in shared environments. The authors argue that multiagent environments are important stepping stones toward AGI because they generate a natural curriculum and never settle into a stable equilibrium. Their approach, centralized training with decentralized execution, lets agents learn coordinated and adversarial behaviors that traditional decentralized methods fail to learn. ## Why Multiagent Environments Matter - The difficulty of the environment scales with the skill of competitors, so agents face a natural curriculum. Competing against clones of oneself produces an environment matched exactly to one's own skill level. - No stable equilibrium exists, so there is constant pressure to improve regardless of how capable an agent already is. ## How MADDPG Works - MADDPG extends DDPG and draws on actor-critic reinforcement learning. - Each agent is an "actor" that selects actions, while a "critic" evaluates those actions by predicting expected future reward, which is more stable than using raw rewards directly. - Each critic can access the observations and actions of all agents during training, enabling globally coordinated behavior. - At test time, agents act only on their own observations plus predictions of others' behavior, so the central critic is not needed during execution. - Because each agent's critic is learned independently, the method also handles arbitrary reward structures, including fully adversarial ones. ## Experimental Results - MADDPG outperformed DDPG on every task tested. - Demonstrated behaviors include two agents learning to split up to hide their intended destination from an opponent, one agent communicating a landmark's name to another, and three agents coordinating to reach landmarks without colliding. - In a predator-prey setup, four red agents learned to team up to chase a single green agent, while green agents learned to split up and use the water to evade them. ## Limitations of Traditional Decentralized RL - Each agent must simultaneously predict others' actions while learning its own, which makes the environment non-stationary and hard to learn, especially in competitive settings. - Policy gradient methods show high variance when rewards are inconsistent. Adding a critic improved stability but still failed on tasks like cooperative communication, suggesting that modeling other agents' actions during training is essential for cooperation. - In early experiments, listener agents learned to ignore speakers that sent inconsistent messages, setting the speaker's weights to zero. Once this happened, the speaker received no feedback and could not recover. Forcing listeners to attend to the speaker did not help, because the speaker still had no signal about which messages were relevant. The centralized critic addresses this by letting speakers learn which utterances matter to other agents' actions. ## Future Directions - Agent modeling has a long history in AI, but earlier work mostly considered games with few time steps and small state spaces. - Deep learning handles complex visual inputs, and RL handles long-horizon behavior. Combined, they allow training multiple agents without requiring knowledge of environment dynamics. - The authors suggest this opens the door to problems involving communication and language learned from high-dimensional environment data.

OpenAI2017-06-042 min readCurated summary

UCB exploration via Q-ensembles

The post proposes using an ensemble of Q-functions to improve exploration in deep reinforcement learning. The authors adapt well-established upper-confidence-bound (UCB) methods from the bandit setting to Q-learning and report significant gains on the Atari benchmark. ## Q-Ensembles for Exploration - The approach uses an ensemble of Q*-functions, several value estimates rather than a single one, to guide how the agent explores. - The ensemble's disagreement provides a signal about which states and actions are still uncertain. ## Adapting Bandit Algorithms to Q-Learning - Methods designed for multi-armed bandits, where each action is a fixed arm with an unknown reward, are carried over to the sequential decision-making setting of Q-learning. - The adaptation lets the proven bandit ideas inform exploration in environments where the agent's actions affect future states. ## UCB-Based Exploration Strategy - The exploration policy selects actions by adding an upper-confidence bonus to value estimates, so that actions with high uncertainty get tried more often. - Because the bonus comes from the ensemble, the agent explores where its own value estimates are least certain. ## Results on Atari - Experiments on the Atari benchmark show significant performance gains over the baselines the authors compare against.

OpenAI2017-05-233 min readCurated summary

OpenAI Baselines: DQN

# OpenAI Baselines: DQN OpenAI is open-sourcing Baselines, an internal library of reinforcement learning algorithms whose implementations are verified to match published results. The first release includes DQN and three of its variants, and the authors argue that known-good implementations make it harder for apparent RL advances to come from comparisons against buggy or undertuned baselines. The post pairs the release with practical advice on avoiding the bugs that commonly make RL results hard to reproduce. ## Why RL Results Are Hard to Reproduce - Performance is very noisy, so results can look like progress when they are not. - Algorithms have many interacting parts, and subtle bugs can hide inside them. - Papers often omit tricks that are needed to reach the reported performance. ## Practical Debugging Practices - **Compare against a random baseline.** An agent taking random actions can appear to learn early in training, as seen in the H.E.R.O. example, so an agent should always outperform a random one to show real learning. - **Watch for silent bugs.** In a review of ten popular RL reimplementations, six had subtle bugs confirmed by their authors. These ranged from ignored gradients and incorrect causal convolutions to implementations reporting scores higher than the true results. - **Inspect what the agent sees.** Converting frames to grayscale with miscalibrated green-channel coefficients erased the fish in Seaquest, which caused poor performance. Gym's new `play` function lets researchers view the same observations the agent receives. - **Fix bugs before tuning hyperparameters.** Bugs can push researchers toward compensating hyperparameter choices. Epsilon annealing had a large effect on performance, with the final schedule decreasing it to 0.1 over the first million steps and then to 0.01 over the next 24 million. - **Interpret papers carefully.** The DQN Nature paper's instruction to clip the error term to between -1 and 1 can mean clipping the objective, which zeroes gradients for high-error transitions, or clipping the gradient multiplier, which corresponds to Huber loss. The second interpretation is the correct one. Checking gradients with TensorFlow's `compute_gradients` can reveal such mistakes. - **Review code repeatedly.** Most bugs were found by re-reading the code line by line and asking what could go wrong, and experienced researchers often underestimate how many passes this takes. ## The Released Algorithms - **DQN:** Combines Q-learning with deep neural networks so RL can handle high-dimensional inputs such as video games and robotics. - **Double Q-learning:** Reduces the tendency of DQN to overestimate action values. - **Prioritized Replay:** Extends experience replay by sampling transitions where actual and expected rewards differ significantly. - **Dueling DQN:** Splits the network into a value stream and an advantage stream, which are combined into a single action-value estimate. ## Getting Started The release installs with `pip install baselines`. Users can train a CartPole model with `baselines.deepq.experiments.train_cartpole`, then visualize the learned policy with `enjoy_cartpole`. Pretrained Atari agents are also available, such as a dueling, prioritized-replay Breakout model that can be downloaded and run with the `atari.download_model` and `atari.enjoy` scripts. ## Benchmarks An included notebook compares the Atari performance of the DQN variants, including Dueling Double Q-learning with Prioritized Replay, Double Q-learning with Prioritized Replay, Dueling Double Q-learning, and Double Q-learning. ## Conclusion Reusable, verified implementations let researchers spend less time reimplementing existing algorithms and more time designing new ones. Anyone reproducing RL results should check against a random baseline, inspect the agent's observations, fix bugs before tuning, verify ambiguous paper details through gradient checks, and review the code thoroughly.

OpenAI2017-05-152 min readCurated summary

Robots that learn

# Training Robots in Simulation to Learn Tasks from a Single Demonstration OpenAI describes a robotics system trained entirely in simulation that can learn a new task after watching one human demonstration, then reproduce that task on a physical robot from a different starting configuration. The approach combines domain randomization for vision with a one-shot imitation learning network, so the robot never needs real-world training images or real demonstrations for its core learning. ## Domain Randomization for Vision - The vision network takes a camera image and outputs a state representation of object positions. - It is trained on hundreds of thousands of simulated images with randomized lighting, textures, backgrounds, and object appearance. - It never sees a real image during training, yet transfers to the physical robot. ## One-Shot Imitation Learning - A human demonstrates the task in VR, and the imitation network infers the task's intent from that single demonstration. - The network then performs the same task from a new starting configuration, so it must generalize rather than replay the exact motions. - Training uses dozens of tasks with thousands of demonstrations each. Each example is a pair of demonstrations of the same task: the network sees the full first demonstration plus one observation from the second, and uses supervised learning to predict the action taken at that observation. - To predict actions well, the network must learn which parts of the first demonstration matter for the task. ## Block Stacking Experiment - The task of stacking color-coded blocks into towers was simple enough to solve with a scripted policy in simulation, which generated the imitation network's training data. - Training pairs started from different initial states but produced towers in the same order, so the network learned to match the demonstrator's block ordering and tower sizes without depending on the towers' relative locations. - Despite never seeing messy human data during training, the network parsed real human demonstrations at test time. - Soft attention over the demonstration trajectory lets the system handle demonstrations of variable length. - Attention over individual block locations lets it imitate longer sequences than it saw in training and build towers with more blocks than any training demonstration. - Injecting modest noise into the scripted policy's outputs was necessary. It forced the demonstrations to include recovery from mistakes, and without it the imitation network usually failed to complete the stacking task.

OpenAI2017-05-143 min readCurated summary

Roboschool

# Roboschool: Open-Source Robot Simulation for OpenAI Gym OpenAI released Roboschool, an open-source robot simulation package integrated with OpenAI Gym. It offers free alternatives to eight MuJoCo environments, re-tuned for more realistic motion, along with new challenging tasks and support for training multiple agents in the same environment. Built on the permissively licensed Bullet Physics Engine, it removes the paid-license barrier that MuJoCo imposed on researchers. ## Free Alternative to MuJoCo - The MuJoCo dependency required a paid license, a common complaint among Gym users, though MuJoCo later added free student licenses. - Roboschool is built on the Bullet Physics Engine, an open-source library also used by simulators such as Gazebo and V-REP. - Twelve environments ship with the package, including ported MuJoCo tasks modified for more realistic behavior and new challenges. - Trained policies for these environments are available in the `agent_zoo` folder, and a `demo_race` script lets three robots race each other. ## Interactive and Robust Locomotion - Earlier Gym walking tasks only required moving forward, so learned policies often settled into a single cyclic gait, left most of the state space unexplored, and fell over after small pushes. - **HumanoidFlagrun** requires the 3D humanoid to run toward a flag whose position changes randomly, teaching it to slow down and turn. - **HumanoidFlagrunHarder** adds more difficulty: episodes start with the robot upright or lying down, the robot may fall and must get back up, and white cubes are constantly thrown at it to knock it off course. - The resulting policies are less fast and natural-looking than the regular humanoid's walk, but they recover from many disturbances and steer well. Because the policy is a multilayer perceptron with no internal state, the authors suspect the agent sometimes uses its arms to store information. ## Multiplayer Training - Roboschool supports running and training multiple agents in one environment, starting with a multiplayer Pong environment. - Setups include self-play (one agent playing both sides), two agents trained with the same algorithm, or two agents trained with different algorithms. - Training both players simultaneously with policy gradient methods caused oscillation: each agent learned a counter-strategy, then overfit to it, and neither improved after hours of training. - The authors note that adversarial learning is difficult, much like GANs, but it can produce sophisticated strategies in simple environments and a natural curriculum, making it a worthwhile research problem. ## Related Work - Other community projects have built Gym environments on open-source physics simulators. One fork replaced MuJoCo with the DART simulator and showed that policies transfer between MuJoCo and DART.

OpenAI2017-04-202 min readCurated summary

Equivalence between policy gradients and soft Q-learning

Q-learning and policy gradient methods, two leading approaches to model-free reinforcement learning, are shown to be closely related in the entropy-regularized setting. The post argues that "soft" (entropy-regularized) Q-learning is exactly equivalent to a policy gradient method, which may partly explain why Q-learning works well despite its inaccurate Q-value estimates. Experiments on Atari support the view that these entropy-regularized variants perform comparably to, or slightly better than, the standard versions. ## Equivalence Between Soft Q-learning and Policy Gradients - The authors establish a precise equivalence between Q-learning and policy gradient updates under entropy regularization. - This suggests Q-learning may be "secretly" implementing policy gradient updates, offering a partial explanation for its effectiveness. - The post notes that Q-learning is often sample-efficient, but its estimated Q-values are typically very inaccurate, so the mechanism behind its success has been poorly understood. ## Connection to Natural Policy Gradients - The authors also identify a link between Q-learning methods and natural policy gradient methods. ## Experimental Results on Atari - Entropy-regularized versions of both Q-learning and policy gradients were evaluated on the Atari benchmark. - They performed as well as, or slightly better than, their standard counterparts. ## Practical Validation Against A3C - To show the equivalence holds in practice, the authors built a Q-learning method whose learning dynamics closely match those of A3C. - Notably, this method works without a target network or an ϵ-greedy exploration schedule, two components common in standard Q-learning. The results suggest that entropy regularization provides a principled bridge between value-based and policy-based reinforcement learning, and that some of Q-learning's practical behavior may be better understood through a policy gradient lens.

OpenAI2017-04-092 min readCurated summary

Stochastic Neural Networks for hierarchical reinforcement learning

This work proposes a two-stage framework for hierarchical reinforcement learning that tackles sparse rewards and long horizons. An agent first learns a library of reusable skills in a pre-training environment, guided by a single proxy reward that requires little domain knowledge about the downstream tasks. A high-level policy then operates over these skills, which improves exploration and lets the agent learn faster in downstream tasks with sparse rewards. ## Motivation - Deep reinforcement learning performs well on many tasks, but sparse-reward and long-horizon tasks remain difficult. - The approach aims to reuse skills learned in advance rather than learning each downstream task from scratch. ## Skill Pre-training with a Proxy Reward - Skills are learned in a pre-training environment using one proxy reward, which combines ideas from intrinsic motivation and hierarchical methods. - The proxy reward needs very little knowledge of the downstream tasks, so the skills are not tailored to any particular one. - Stochastic Neural Networks are used to represent a broad span of skills efficiently. - An information-theoretic regularizer encourages the learned skills to be diverse and distinguishable. ## High-level Policy for Downstream Tasks - A high-level policy is trained on top of the pre-trained skills and chooses which skill to use. - Working at the level of skills improves exploration, which helps where rewards are sparse. ## Experimental Results - The learned skills are interpretable and were acquired sample-efficiently. - Learning performance improved consistently across a wide range of downstream tasks.

OpenAI2017-04-053 min readCurated summary

Unsupervised sentiment neuron

# Unsupervised Sentiment Neuron: Learning Sentiment by Predicting the Next Character OpenAI researchers trained a multiplicative LSTM with 4,096 units to predict the next character in 82 million Amazon reviews, without any sentiment labels. The resulting representation contains a single unit that tracks sentiment with high precision. A linear model built on these features reaches state-of-the-art accuracy on the Stanford Sentiment Treebank while using 30 to 100 times fewer labeled examples than prior supervised systems. The authors argue that large next-step prediction models can learn useful, interpretable representations as a side effect of this simple objective. ## Training Setup - A multiplicative LSTM with 4,096 units was trained on 82 million Amazon reviews to predict the next character. - Training took one month on four NVIDIA Pascal GPUs and processed about 12,500 characters per second. - The 4,096-unit state vector serves as a feature representation of the input text. - A sentiment classifier was built by learning a linear combination of these units from labeled data. ## Discovery of the Sentiment Neuron - While fitting an L1-regularized linear model, the researchers noticed it relied on very few units. - Further analysis revealed a single unit, dubbed the "sentiment neuron," that is highly predictive of sentiment. - Because this neuron can be directly overwritten, the model offers a simple control over the sentiment of generated text. - Visualizing the neuron character by character shows large shifts on strongly polar words such as "best" and "horrendous," and also after sentence endings, where the neuron summarizes the sentiment of the completed clause. ## Results - On the Stanford Sentiment Treebank, the approach reaches 91.8% accuracy, up from the previous best of 90.2%. - The L1-regularized model matches a multichannel CNN with only 11 labeled examples, and matches CT-LSTM ensembles with 232 examples. Each comparison baseline was trained on 6,920 examples. ## Implications for Unsupervised Learning - Labeled data is expensive to collect at scale, so tasks without strong economic incentives often lack good models. - Learning good general representations without labels has long been a goal, and this work suggests next-step prediction on large data is a promising route. - The authors believe the effect is a general property of large networks trained to predict their next input, not specific to this architecture. ## Limitations and Future Directions - Performance drops on long documents, which the authors attribute to the character-level model struggling to retain information over hundreds to thousands of timesteps. Hierarchical models that adapt their timescales are suggested as a remedy. - The representation weakens as input text diverges from the review domain, so broader training corpora need to be tested. - The authors propose extending the idea to video, training models to predict future frames in order to learn representations for object, scene, and action classification.

OpenAI2017-03-312 min readCurated summary

Spam detection in the physical world

# Spam Detection in the Physical World OpenAI reports building what it calls the first Spam-detecting AI trained entirely in simulation and deployed on a physical robot. The approach addresses the costly data collection that bottlenecks robotic perception, using domain randomization to let a model trained only on synthetic images transfer to real-world scenes without retraining. ## The Data Bottleneck in Robotics - Deep learning robotic systems require hundreds of thousands of images to train perception alone, which is expensive to collect. - Simulated data is cheap to generate, but the gap between simulation and reality usually forces teams to retrain models from scratch on physical data. ## Domain Randomization for Sim-to-Real Transfer - Domain randomization is an existing technique that OpenAI applied to cluttered scenes. - The method randomly varies colors, textures, lighting conditions, and camera settings across simulated scenes. - The resulting variability is enough for a neural network to generalize to reality rather than overfitting to the simulator's appearance. - Each generated frame contains Spam, often partially hidden among distractor objects. The Spam model comes from the YCB object dataset. ## The Detection Model - The detector is a neural network based on the VGG16 architecture. - It predicts the precise 3-D location of Spam in an image. - Despite being trained only on simulated scenes, it detects Spam in real images, including when unfamiliar distractor items are arranged in random configurations. ## Future Work - The team plans to extend the system to phishing detection. - They also intend to defend against adversarial Spam, meaning inputs deliberately designed to fool the detector. The core takeaway is that randomizing the visual properties of simulated environments can produce perception models that work on physical hardware with no real-world training data.