techlist.io

Data Augmentation

2 posts

OpenAI2022-07-272 min readCurated summary

Efficient training of language models to fill in the middle

Autoregressive language models can learn to fill in text in the middle of a document with a simple data transformation: a span is moved from the middle of a document to its end. The authors show that training with a large fraction of data transformed this way does not hurt standard left-to-right generation, as measured by perplexity and sampling across a range of model scales. Because the method is useful, simple, and efficient, they argue that future autoregressive models should be trained with fill-in-the-middle (FIM) by default. ## The Transformation - A span of text is cut from the middle of a document and placed at the end. - The model is trained on the rearranged sequences, which lets it learn infilling with no change to the architecture. - Data augmentation of this kind has drawn considerable interest, but the authors focus on whether it costs anything in left-to-right performance. ## Preserving Left-to-Right Capability - Training with a large share of transformed data does not degrade original generative ability. - The authors check this with perplexity and sampling evaluations across a wide range of model scales. ## Recommended Training Practices - The authors run ablations on key hyperparameters: the frequency of the data transformation, the structure of the transformation, and the method for selecting the infill span. - These ablations produce recommended default settings and best practices for training FIM models. ## Released Resources - The authors released their best infilling model, trained with these practices, through their API. - They also released their infilling benchmarks to support future research.

OpenAI2018-01-304 min readCurated summary

Requests for Research 2.0

OpenAI released a second batch of seven unsolved research problems in January 2018, meant as an entry point for newcomers and a way for practitioners to sharpen their skills. Two warmup problems have known solutions, and the rest are open-ended and difficulty-rated, with many requiring new ideas. The problems span sequence modeling, multi-agent reinforcement learning, distributed training, transfer learning, efficient attention, data augmentation, regularization in RL, and automated theorem proving. ## Warmup Problems - **Learning XOR with an LSTM:** Train an LSTM to output the parity of a bit sequence after reading it one bit at a time. Test on 100,000 random binary strings of fixed length 50, then on strings whose lengths are drawn uniformly from 1 to 50, and explain any difference in results. - **Snake as a Gym environment:** Implement the classic Snake game as a Gym environment and train a reinforcement learning policy that can win it. ## Multi-Agent Self-Play in a Snake Environment - The "Slitherin'" problem asks for a multiplayer Snake environment inspired by slither.io, with a large field, randomly appearing fruit that grows snakes, and deaths from collisions with other snakes, oneself, or walls. - Start with two snakes and scale up. The game ends when all snakes die. - Train with self-play, which tends to be unstable in a way similar to GANs. Possible fixes include training the current policy against a distribution of past policies. - Analyze whether agents learn to pursue food and avoid collisions, and whether they learn aggressive tactics like trapping or ganging up on opponents. ## Distributed RL and Parameter Averaging - Study how parameter averaging schemes affect sample complexity and communication cost. - Averaging gradients from every worker on every update is the simplest approach. Alternatives include letting workers update independently and averaging parameters infrequently, or using EASGD to pull parameters partly together at each update. - Independent workers may hold different parameters at any moment, which could improve exploration. ## Transfer Learning Through Generative Models - Train good policies for 11 Atari games and generate 10,000 trajectories of 1,000 steps per game. - Fit a generative model, such as a Transformer, on trajectories from 10 games, then fine-tune it on the 11th. - Measure how large the model must be for pre-training to help, and how the benefit changes when the 11th game's data is reduced by 10x and 100x. ## Linear Attention Transformers - Replace softmax attention with linear attention, which can be run as an RNN with fast weights. This would make RL rollouts over very long contexts practical. - The goal is to match the bits-per-character or bits-per-word of a standard Transformer on a language modeling task, using a linear-attention model with different hyperparameters and a similar parameter count. - The authors suggest linear attention may need much higher-dimensional key and value vectors, and that this may prove impossible. ## Learned Data Augmentation - Train a VAE on the inputs, then augment each training point by encoding it, adding a small Gaussian perturbation in latent space, and decoding it back. - The hope is that this captures nonlinear transformations such as viewpoint or lighting changes, and approximates the transformations under which labels are invariant. ## Regularization in Reinforcement Learning - Empirically test and qualitatively explain how regularizers like dropout, batch normalization, and L2 affect RL algorithms such as policy gradients and Q-learning, where they have historically helped little. - RL practitioners use much smaller models than supervised learning does, and larger models often perform worse, possibly because they overfit to recent experience. ## Automated Olympiad Inequality Proving - Build a dataset of olympiad inequality problems and write a program that solves a large share of them. - Machine learning may or may not help, but a learned policy could reduce the search branching factor.