techlist.io

OpenAI/Deep Learning

36 posts

OpenAI2023-03-134 min readCurated summary

GPT-4

# GPT-4: Scaling Up Multimodal Capability with Predictable Training and Stronger Safety OpenAI introduces GPT-4, a large multimodal model that accepts image and text inputs and produces text outputs. While less capable than humans in many real-world settings, it reaches human-level performance on many professional and academic benchmarks, such as scoring around the top 10% on a simulated bar exam. The post argues that GPT-4 is a meaningful step forward in reliability, factuality, and steerability, while acknowledging that hallucinations and other limitations remain. ## Capabilities and Benchmarks - GPT-4 is noticeably more reliable, creative, and able to follow nuanced instructions than GPT-3.5, with the gap becoming clearer as task complexity rises. - Exam results were measured on recent public tests and 2022–2023 practice exams, with no exam-specific training, though a minority of problems may have appeared in training data. - On traditional ML benchmarks, GPT-4 outperforms existing large language models and most state-of-the-art systems. - On the MMLU benchmark translated into 26 languages via Azure Translate, GPT-4 beats GPT-3.5's English performance in 24 of them, including low-resource languages like Latvian, Welsh, and Swahili. - Internally, GPT-4 is used for support, sales, content moderation, and programming, and to help humans evaluate AI outputs. ### Visual Inputs - GPT-4 accepts interleaved text and images and generates text output, supporting tasks on documents, diagrams, and screenshots. - Text-only techniques such as few-shot and chain-of-thought prompting carry over to image inputs. - Image input was a limited research preview at launch, working first with a single partner. ### Steerability - Developers can define tone, style, verbosity, and task through a "system" message instead of relying on a fixed ChatGPT persona. - Adherence to these boundaries is imperfect, and system messages are the easiest route to jailbreaking the model. ## Limitations and Factuality - GPT-4 still hallucinates facts and makes reasoning errors, so high-stakes uses need human review, grounding in context, or avoidance altogether. - It scores 40% higher than GPT-3.5 on OpenAI's internal adversarial factuality evaluations. - On TruthfulQA, the base model barely improves on GPT-3.5, but after RLHF post-training a large gap emerges, though subtle errors still occur. - Knowledge ends around September 2021, the model does not learn from experience, and it can be overly gullible or introduce security vulnerabilities in code. - The pre-trained base model is well calibrated, but post-training reduces that calibration. ## Risks and Mitigations - Over 50 experts in areas such as AI alignment, cybersecurity, biorisk, and international security adversarially tested the model. - An additional safety reward signal during RLHF, provided by a GPT-4 zero-shot classifier, trains the model to refuse harmful requests while still allowing valid ones. - Compared with GPT-3.5, GPT-4 is 82% less likely to respond to disallowed content and 29% more likely to respond to sensitive requests in line with policy. - Jailbreaks remain possible, so the post stresses deployment-time safeguards such as abuse monitoring. ## Training and Predictable Scaling - The base model is trained to predict the next word on a web-scale corpus that includes both correct and incorrect reasoning, then fine-tuned with RLHF to match user intent. - Capabilities mostly come from pre-training, while RLHF mainly steers behavior and can slightly degrade exam performance. - OpenAI built infrastructure whose behavior is predictable across scales, forecasting GPT-4's final loss using models trained with 10,000x less compute. - Pass rates on a subset of HumanEval were predicted using models trained with 1,000x less compute. - Some capabilities remain hard to predict, such as tasks from the Inverse Scaling Prize, where GPT-4 reverses the negative trend. ## OpenAI Evals - Evals is an open-source framework for building benchmarks and inspecting model performance sample by sample, letting anyone report shortcomings. - It includes templates for common benchmark patterns and a "model-graded" template, since GPT-4 is surprisingly good at checking its own work. - Stripe uses Evals to measure the accuracy of a GPT-powered documentation tool. ## Access and Pricing - ChatGPT Plus subscribers get GPT-4 with a usage cap that may be adjusted based on demand. - The API is available through a waitlist, using the same ChatCompletions API as gpt-3.5-turbo. - The 8K-context model costs $0.03 per 1K prompt tokens and $0.06 per 1K completion tokens. The 32K-context model costs $0.06 and $0.12 respectively. - Default rate limits are 40k tokens per minute and 200 requests per minute, and researchers studying societal impact or alignment can apply for subsidized access.

OpenAI2021-07-274 min readCurated summary

Introducing Triton: Open-source GPU programming for neural networks

# Triton: Open-Source Python-Like GPU Programming for Neural Networks Triton 1.0 is an open-source, Python-like language that lets researchers with little or no CUDA experience write GPU kernels that usually approach expert-level CUDA performance. Its main claim is that it automates the hardest parts of GPU optimization, such as memory coalescing, shared memory management, and within-SM scheduling, so developers can focus on high-level logic. The post argues this makes it practical to write fused kernels, including FP16 matrix multiplication that matches cuBLAS in under 25 lines, some up to 2x faster than equivalent PyTorch implementations. ## Why Fused Kernels Matter - Research code typically chains native framework operators, which creates many temporary tensors and data movement that hurt performance at scale. - Custom GPU kernels can fix this, but writing them is difficult. - Existing alternatives were either too verbose, too inflexible, or produced code noticeably slower than hand-tuned baselines. - Triton extends an earlier language and compiler of the same name, originally created by Philippe Tillet, who now works at OpenAI. ## The Challenges of GPU Programming Optimizing CUDA code requires attention to three components of modern GPUs: - **DRAM:** memory transfers must be coalesced into large transactions to use the wide memory bus. - **SRAM (shared memory):** data must be staged manually for reuse and arranged to avoid bank conflicts. - **ALUs:** computations must be partitioned and scheduled across and within Streaming Multiprocessors (SMs) to exploit parallelism and specialized units like tensor cores. Triton automates memory coalescing, shared memory management, and within-SM scheduling. It deliberately leaves cross-SM scheduling to the developer, since tiling and inter-SM synchronization remain algorithmic decisions that should stay flexible. ## Programming Model - Triton resembles Numba: kernels are decorated Python functions launched over a grid of program instances identified by `program_id`. - Unlike Numba, Triton parallelizes within an instance through operations on blocks (small power-of-two-sized arrays) rather than the SIMT thread model. This hides intra-block concurrency issues such as coalescing, shared memory synchronization, and tensor core scheduling. - Element-wise operations gain little, but complex kernels become much simpler. - **Fused softmax example:** each instance loads and normalizes one row using NumPy-like primitives, avoiding the explicit inter-thread synchronization that a CUDA version requires. - Triton JIT treats tensors as raw pointers, preserving low-level control needed for complex structures such as block-sparse tensors. - This softmax keeps each row in SRAM throughout normalization, maximizing reuse for up to about 32K columns. PyTorch's general-purpose CUDA implementation uses temporary memory, making it more flexible but slower. The post frames the lesson as simplifying specialized kernels, not Triton being inherently superior. - The Torch JIT (v1.9) performed worse on the same operation, illustrating how hard it is to automatically generate efficient CUDA from high-level tensor operations. ## Matrix Multiplication - Fused element-wise operations and reductions are necessary, but matrix multiplication is central to neural networks. - A Triton matmul reaches peak performance in about 25 lines of Python. The equivalent CUDA would take considerably more effort and would likely be slower. - The kernel groups programs together to improve L2 cache hit rates, loads blocks of A and B in a loop, accumulates with `tl.dot`, and stores results with boundary masks. - Handwritten kernels can be customized with fused input transformations (such as slicing) and output transformations (such as Leaky ReLU), which would be out of reach for most developers without Triton. ## System Architecture and Compiler - Triton's performance comes from Triton-IR, an LLVM-based intermediate representation where multi-dimensional blocks of values are first-class. - The `@triton.jit` decorator walks the Python AST and builds Triton-IR using an SSA construction algorithm. - The compiler simplifies and optimizes the IR, automatically parallelizes it, and lowers it through LLVM-IR to PTX for recent NVIDIA GPUs. - Stashing data in shared memory is automated by analyzing operands of block-level operations like `tl.dot`, with allocation and synchronization handled by standard liveness analysis. - Programs are parallelized across SMs by running kernel instances concurrently, and within SMs by partitioning block-level iteration spaces across SIMD units. - At the time of the post, CPUs and AMD GPUs were unsupported, and the authors invited community contributions. ## Conclusion Triton is open source on GitHub and the authors want it to become a community-driven project. For developers who need custom GPU kernels but lack deep CUDA expertise, it offers a practical path to near-expert performance with far less code.

OpenAI2021-01-044 min readCurated summary

CLIP: Connecting text and images

# CLIP: Connecting Text and Images OpenAI's CLIP (Contrastive Language–Image Pre-training) is a neural network that learns visual concepts from text paired with images found on the internet, rather than from manually labeled datasets. Because it is trained to match images with natural-language descriptions, it can be applied to new image classification tasks simply by supplying the category names, without task-specific training. The authors argue this zero-shot approach produces benchmark results that better reflect real-world performance, since the model is never optimized directly for the benchmark. ## Problems with Standard Computer Vision Models - Labeled vision datasets are expensive to build and cover only a fixed set of predetermined concepts. ImageNet required over 25,000 workers to annotate 14 million images across 22,000 categories. - Standard models are narrow. An ImageNet model handles its 1,000 categories well but needs a new dataset, a new output head, and fine-tuning for any other task. - Benchmark scores overstate real-world performance. Models that look superhuman on benchmarks often fail on stress tests, which the authors attribute to models effectively "studying for the test." ## How CLIP Works - CLIP is trained on a proxy task: given an image, predict which of 32,768 randomly sampled text snippets was actually paired with it. - Solving this forces the model to learn many visual concepts and associate them with their names. - For classification, the category names are turned into text prompts (e.g., "a photo of a dog" vs. "a photo of a cat"), and the model picks the prompt most likely to match the image. ## Background and Prior Work - Zero-data learning has been studied for over a decade, but natural language as a flexible prediction space was a key insight. - Socher et al. (2013) showed a model trained on CIFAR-10 could predict two unseen classes by using word vector embeddings. - DeVISE (2013) extended this to generalize beyond ImageNet's 1,000 training classes. - Li et al. (2016/2017) were the most direct inspiration. They trained on 30 million Flickr photos with their titles, descriptions, and tags, reaching 11.5% zero-shot accuracy on ImageNet. - Recent work such as VirTex, ICMLM, and ConVIRT explored related language-supervised objectives using Transformers, with ConVIRT applying a contrastive objective to medical imaging. ## Key Results **Efficiency** - A contrastive objective (matching images to text) was 4x to 10x more efficient than an image-to-text approach for zero-shot ImageNet classification in small to medium experiments. - Switching from a standard ResNet to a Vision Transformer gave a further 3x compute efficiency gain. - The best model trained on 256 GPUs for 2 weeks. **Flexibility** - Zero-shot performance was measured across more than 30 datasets, including fine-grained object classification, geo-localization, video action recognition, and OCR. - With linear probes, the best CLIP model outperformed the best public ImageNet model (Noisy Student EfficientNet-L2) on 20 of 26 transfer datasets. - Fitting a linear classifier on ImageNet raised CLIP's ImageNet test accuracy by nearly 10%, but gave no average gain across seven other robustness datasets. This supports the authors' "cheating hypothesis." - CLIP closes the robustness gap by up to 75% while matching the original ResNet-50's ImageNet accuracy zero-shot, without using any of its 1.28M labeled training examples. ## Limitations - CLIP struggles with abstract or systematic tasks such as counting objects or estimating distance to the nearest car, where it is only slightly better than random guessing. - It lags task-specific models on fine-grained classification, such as car models, aircraft variants, and flower species. - Generalization is limited. On handwritten MNIST digits, zero-shot CLIP reaches 88% accuracy versus 99.75% for humans. - Performance can be sensitive to wording, sometimes requiring trial-and-error "prompt engineering." ## Broader Impacts - Class design strongly affects bias. With FairFace race labels and a few offensive terms, about 32.3% of images of people aged 0–20 were classified into the offensive category. Adding a "child" class reduced this to about 8.7%. - Celebrity identification reached 59.2% top-1 accuracy among 100 candidates and 43.3% among 1,000. This is not competitive with production systems, but it raises privacy and surveillance concerns that the authors flag for further research. ## Conclusion The authors show that task-agnostic pre-training on internet-scale natural language, which drove recent progress in NLP, can also improve computer vision. Like the GPT models, CLIP learns many tasks during pre-training and transfers to them zero-shot. The authors also argue that zero-shot evaluation gives a more representative measure of a model's capability.

OpenAI2020-09-061 min readCurated summary

Generative language modeling for automated theorem proving

This post introduces GPT-f, a transformer-based language model for automated theorem proving in the Metamath formalization language. The authors argue that a key weakness of automated provers compared to human mathematicians is their difficulty generating original mathematical terms, and that language model generation may address this gap. GPT-f found new short proofs that were accepted into the main Metamath library, which the authors believe is the first time a deep-learning system has contributed proofs adopted by a formal mathematics community. ## Motivation - Automated theorem provers struggle to generate original mathematical terms, a capability humans have. - The authors propose that generation from language models could address this limitation. ## GPT-f: Prover and Proof Assistant - GPT-f is both an automated prover and a proof assistant. - It targets the Metamath formalization language. ## Results - GPT-f discovered new short proofs. - These proofs were accepted into the main Metamath library, marking, to the authors' knowledge, the first adoption of deep-learning-generated proofs by a formal mathematics community.

OpenAI2020-04-132 min readCurated summary

OpenAI Microscope

# OpenAI Microscope: Visualizing Neurons in Vision Models OpenAI has released Microscope, a collection of visualizations covering every significant layer and neuron in eight vision "model organisms" commonly used in interpretability research. The goal is to make neural network features easier to analyze, share, and cite, so that researchers can quickly evaluate claims about specific neurons and collaborate across institutions. ## Why Neuron-Level Exploration Is Hard - Modern network capabilities emerge from interactions among thousands or tens of thousands of neurons, so understanding behavior requires examining those interactions in detail. - Collaboration suffers when claims about neurons cannot be checked quickly. For example, a claim that one InceptionV1 neuron is a car detector built from wheel and window detectors is hard to verify without tooling. - Generating visualizations yourself is tedious and can take hundreds of GPU hours for systematic coverage. ## What Microscope Provides - **Systematic visualizations:** Every neuron in several commonly studied vision models is visualized, using the open-source lucid library that OpenAI helps maintain. - **Faster feedback loops:** Exploring a neuron drops from minutes to seconds. The OpenAI team says this speed helped them discover unexpected features, such as high-low frequency detectors, in the ongoing circuits project. - **Linkable neurons and models:** Each model and neuron has a stable link, so readers can scrutinize claims directly and avoid ambiguity about which version of a model is meant (for example, which of the five InceptionV1 variants). - **Lower compute barrier:** By sharing precomputed visualizations, OpenAI aims to keep interpretability research accessible to researchers without large compute budgets. ## Scope and Focus - The initial release covers nine frequently studied vision models along with several visualization techniques the team found especially useful. - Following the "model organism" approach in biology, Microscope concentrates on a small set of models studied in depth rather than spreading across many architectures. - OpenAI plans to add more models and techniques in the coming months. ## Intended Use The assets are free for reuse. OpenAI specifically highlights their potential for supporting the Circuits collaboration, a project that reverse engineers neural networks by analyzing individual neurons and the connections between them.

OpenAI2020-01-222 min readCurated summary

Scaling laws for neural language models

The study examines how language model performance on cross-entropy loss scales with model size, dataset size, and training compute. It finds that performance follows simple power laws across more than seven orders of magnitude, with architectural details like width and depth mattering little within a wide range. Because larger models are more sample-efficient, the compute-optimal strategy is to train very large models on a relatively modest amount of data and stop well before convergence. ### Power-Law Scaling - Loss follows a power law in model size, dataset size, and training compute. - These trends hold across more than seven orders of magnitude. ### Architecture Matters Less Than Scale - Network width and depth have minimal effects on performance within a wide range. ### Overfitting and Training Speed - Simple equations describe how overfitting depends on model and dataset size. - Simple equations also describe how training speed depends on model size. ### Allocating a Fixed Compute Budget - The relationships above make it possible to determine the optimal way to divide a fixed compute budget. - Larger models are significantly more sample-efficient, so they reach a given loss with less data. - The most compute-efficient training therefore uses very large models trained on a relatively small dataset, and stops significantly before convergence. For teams with limited compute, the practical takeaway is to prioritize model size over dataset size and to avoid training to convergence.

OpenAI2019-12-121 min readCurated summary

Dota 2 with large scale deep reinforcement learning

OpenAI Five became the first AI system to defeat world champions at an esports game when it beat Team OG, the Dota 2 world champion, on April 13, 2019. The work shows that self-play reinforcement learning, scaled up substantially, can reach superhuman performance on a task with long time horizons, imperfect information, and complex continuous action spaces. ## Why Dota 2 Is a Hard Problem - The game has long time horizons, so decisions made early can pay off only much later. - Players have imperfect information about the map and opponents. - The state and action spaces are complex and continuous, which makes them difficult for AI systems to handle. ## Training at Scale - OpenAI Five used existing reinforcement learning techniques but scaled them far beyond typical settings. - Training learned from batches of roughly 2 million frames every 2 seconds. - The team built a distributed training system and tools for continual training. - Training ran for 10 months in total. ## Results - OpenAI Five defeated the reigning Dota 2 world champion. - The result supports the claim that self-play alone, given enough scale, can produce superhuman play on a difficult, real-time strategy task.

OpenAI2019-12-042 min readCurated summary

Deep double descent

# Deep Double Descent OpenAI's research shows that the double descent phenomenon appears in modern deep learning architectures, including CNNs, ResNets, and transformers. Performance first improves, then worsens, then improves again as model size, data size, or training time increases. The effect is often hidden by careful regularization. The authors do not yet fully understand why it happens and call further study an important research direction. ## Model-wise Double Descent Test error follows a non-monotonic curve as parameter count grows, which contradicts both classical statistics ("larger models overfit") and the modern view that bigger is always better. - Test error decreases, rises, and then decreases again as the number of parameters increases. - The peak occurs at the "critical regime" (the interpolation threshold), where the model is just barely able to fit the training set. - Changes that move the interpolation threshold, such as the optimizer, the number of training samples, or the amount of label noise, move the test error peak with it. - The effect is most visible with added label noise. Without it, the peak is smaller and easy to miss. ## Sample-wise Non-monotonicity Adding more training data can make performance worse. - In transformer experiments on a language-translation task without label noise, more samples generally lower the test error curve. - More samples also require larger models to fit, which shifts the interpolation threshold and its test error peak to the right. - For intermediate model sizes, these two effects combine, and training on 4.5x more samples actually hurts test performance. ## Epoch-wise Double Descent The double descent pattern also appears over training time for a fixed model size. - As training proceeds, test and train error decrease, increase, and decrease again. - The peak again appears when the model is just barely able to fit the training set. - The authors' intuition is that at the interpolation threshold, only one model fits the training data, and forcing it to fit slightly noisy labels destroys its global structure. - In the over-parameterized regime, many models fit the training set, and some of them generalize well. The implicit bias of stochastic gradient descent appears to steer training toward these models, though the authors do not yet understand why. ## Practical Takeaway Regularization and early stopping can hide the peak, so practitioners should not assume that more data, larger models, or longer training always helps. Performance can degrade in the critical regime before it recovers.

OpenAI2019-04-244 min readCurated summary

MuseNet

# MuseNet: Generating Multi-Instrument Music with a Transformer OpenAI's MuseNet is a deep neural network that generates 4-minute musical compositions for up to 10 instruments and blends styles from country to Mozart to the Beatles. Rather than being programmed with music theory, it learned harmony, rhythm, and style by predicting the next token across hundreds of thousands of MIDI files, using the same general-purpose transformer approach as GPT-2. The post presents the model's controls, architecture, data encoding, and limitations, and shows that the same long-context modeling that works for text also works for music. ## Style Blending and Conditioning - The model can merge styles, such as starting from the first six notes of a Chopin Nocturne and generating a pop arrangement with piano, drums, bass, and guitar. - A simple mode offers pre-generated samples by composer or style, while an advanced mode lets users interact with the model directly and produce new pieces. - Composer and instrumentation tokens are prepended to training samples, so at generation time a prompt (such as a Rachmaninoff opening or a Journey-style band setup) steers the output. - t-SNE visualizations of the embeddings show how the model groups composers and styles by cosine similarity. ## Limitations - Requested instruments are strong suggestions, not guarantees, because each note is sampled from probabilities across all notes and instruments. - Unusual pairings, such as Chopin with bass and drums, produce less natural results. Choosing instruments close to the composer's or band's typical sound works better. ## Architecture and Long-Term Structure - MuseNet is a 72-layer Sparse Transformer with 24 attention heads and full attention over a 4096-token context, using the recompute and optimized kernels from the Sparse Transformer work. - The long context lets it keep structure over long spans, as seen in its Chopin and Mozart imitations. - Music is a useful test domain because it sits between text and images. It has text-like fluid token structure, yet errors in long-range structure, such as broken rhythm, are easy to hear, whereas a text model's brief tangent is less obvious. ## Training Data and Encoding - Data came from ClassicalArchives and BitMidi, several online collections spanning jazz, pop, African, Indian, and Arabic styles, and the MAESTRO dataset. - The team tested chordwise encodings (one token per simultaneous note combination) and note-onset encodings with byte pair encoding compression. - Time was marked either relative to tempo (in beats) or in absolute seconds. - The final encoding combines pitch, volume, and instrument into a single token, balancing expressiveness and conciseness. - Augmentations included transposition (reduced later in training to keep notes within instrument ranges), volume scaling, timing changes for the absolute-time encoding, and mixup in the token embedding space. - An inner critic predicts whether a sample is from the dataset or from the model's own past outputs, and this score is used to select samples at generation time. ## Embeddings - A learned timing embedding gives all notes sounding simultaneously the same time signal. - Per-note embeddings within a chord approximate relative attention, letting the model learn patterns like "note 4 looks back at note 3." - Two structural embeddings locate the sample within the piece: one divides the piece into 128 parts, and the other counts down from 127 to 0 as the end token approaches. ## Conclusion MuseNet shows that a general-purpose next-token transformer, given the right encoding, conditioning, and long context, can produce coherent multi-instrument music in many styles. The post invites musicians to experiment with the demo and contribute MIDI data, and notes that a live concert of previously unheard MuseNet pieces was streamed on April 25, 2019.

OpenAI2019-04-223 min readCurated summary

Generative modeling with sparse transformers

# Generative Modeling with Sparse Transformers OpenAI's Sparse Transformer is a deep neural network that sets new benchmarks for predicting the next element in a sequence, whether text, images, or audio. By replacing standard self-attention with a sparse variant that scales as O(N√N) instead of O(N²), the model handles sequences roughly 30 times longer than previously feasible, reaching tens of thousands of elements across hundreds of layers. The authors position this as a step toward modeling the long-range, subtle dependencies that complex data like images and audio demand. ## Why Dense Attention Becomes a Bottleneck - In Transformers, every output element attends to every input element, requiring an N×N attention matrix for each layer and attention head. - For high-dimensional data, this memory cost grows quickly. A deep 64-layer, 4-head Transformer needs about 9.6 GB to store attention matrices for a 32×32 CIFAR-10 image, and about 154 GB for a 64×64 ImageNet image. Typical deep learning GPUs have 12–32 GB. - Recomputing attention matrices from checkpoints during backpropagation keeps the dominant memory cost independent of depth, which allows training networks up to 128 layers deep. These deeper models outperformed shallower ones on benchmarks like CIFAR-10. - Training at this depth required changes to the order of operations within the Transformer block and a modified initialization scheme. ## Sparse Attention Patterns - Each output position attends only to a subset of input positions, ideally about √N elements instead of N, reducing complexity to O(N√N). - Visualizing learned attention in deep image models showed many heads with structured, sparse patterns, though some layers attended across the whole image. - To preserve global reach, the authors use a two-dimensional factorization in which any position can reach any other in two sparse steps: - **Strided attention** has each position attend to its row and column, suited to images. - **Fixed attention** attends to a fixed set of column positions and all later elements, suited to data without a 2D structure, such as text. ## Results - **CIFAR-10 (bits per dim):** The 59M-parameter Sparse Transformer reached 2.80, beating PixelCNN++ (2.92), Image Transformer (2.90), and PixelSNAIL (2.85). - **Enwik8 (bits per byte):** The 95M-parameter model reached 0.99, matching the 277M-parameter Transformer-XL and outperforming the 88M version (1.03). - **ImageNet 64×64 (bits per dim):** The 152M-parameter model reached 3.44, improving on SPN 150M (3.52) and Gated PixelCNN (3.57). - Sparse attention also achieved lower loss than full attention while running significantly faster, which the authors suggest may reflect a useful inductive bias or an optimization issue with dense attention. ## Generation Capabilities - **Images:** Models trained on 64×64 ImageNet produce completions that show coherent global structure. Unconditional samples at temperature 1.0 reflect the full learned distribution, so some look unusual. - **Raw audio:** By changing the position embeddings, the same architecture generates raw waveforms. The model produced 65,000-sample sequences, about 5 seconds of classical music. - **Open-source kernels:** The team released block-sparse GPU kernels and example sparse attention functions, since implementing sparse attention by slicing query and key matrices is otherwise cumbersome. ## Limitations and Future Directions - The attention patterns introduced are preliminary. The authors see learned sparsity patterns as a promising direction for future architectures. - Autoregressive generation remains impractical for very high-resolution images or video. The optimized attention primitives may still be useful when combined with multi-scale approaches.

OpenAI2019-04-143 min readCurated summary

OpenAI Five defeats Dota 2 world champions

# OpenAI Five Becomes the First AI to Beat Esports World Champions OpenAI Five defeated OG, the reigning Dota 2 world champions, in two consecutive games at the Finals, marking the first time an AI has beaten world champions in an esports game and the first time it has done so on livestream. The post argues that the key to this milestone was scale rather than new algorithms, and that the same system could be turned from a competitor into a cooperative teammate with relatively little effort. ## Why Dota Was a Hard Target - The team chose Dota because it seemed beyond existing deep reinforcement learning methods, expecting to need ideas like hierarchical RL. - The main missing ingredient turned out to be scale. Their system, Rapid, ran PPO at unprecedented size, and they reached world-class play without hitting fundamental performance limits. - RL's data appetite remains a limitation. Rapid also trained a robotic hand in simulation to reorient a block, but reducing the required experience is a major open challenge. ## Compute and Training Scale - The Finals version beat The International 2018 version with a 99.9% winrate, though this figure is measured on the current patch, which favors the newer agent. - Compute increased 8x. The model consumed 800 petaflop/s-days and about 45,000 years of self-play over 10 realtime months, up from roughly 10,000 years over 1.5 months. - Since most compute was already devoted to a single model, the team scaled by training for longer rather than adding resources. ## Continuous Training and Transfer - The model has trained continuously since June 2018 through changes in model size and game rules, including major patches and new features. - The team built "surgery" tooling to transfer trained parameters across substantial architecture changes, addressing an open problem in RL. ## Expanding the Hero Pool - Going from 5 to 18 heroes caused little slowdown in training. Pools of up to 25 heroes reached about 5k MMR but did not reach pro level in time. - Hypotheses for the slowdown include limited model capacity, matchmaking issues with a larger pool, and the difficulty new heroes face catching up to mastered ones. - The Finals version uses 17 heroes, with Lich removed due to significant ability changes in patch 7.20. ## Cooperative Play - Although trained only by playing against copies of itself, the model generalized zero-shot to controlling a subset of heroes alongside or against humans. - Testers reported feeling supported by their bot teammates and found the experience enjoyable. ## Public Arena and Next Steps - OpenAI Five Arena lets the public play against the bot in competitive and cooperative modes from April 18 to April 21, 2019, with results posted to a public leaderboard. This tests how exploitable the system is. - A more technical analysis will follow the Arena results, and the team plans to keep using Dota 2 as a research environment for learning from less data and for human-AI cooperation. **Conclusion:** The post presents OpenAI Five's win as evidence that scaling existing RL methods can reach expert performance in complex environments, while data efficiency and robust human-AI cooperation remain open problems.

OpenAI2018-10-304 min readCurated summary

Reinforcement learning with prediction-based rewards

# Random Network Distillation: Curiosity-Driven Exploration That Cracks Montezuma's Revenge OpenAI introduces Random Network Distillation (RND), a prediction-based curiosity method that encourages reinforcement learning agents to explore. RND is the first approach to exceed average human performance on Montezuma's Revenge, a game that had long resisted exploration-based methods. It works by rewarding agents for visiting states that are hard to predict, and it avoids the classic failure modes of earlier curiosity approaches. The method can be combined with any RL algorithm and scales efficiently. ## The Long-Standing Challenge of Montezuma's Revenge - DQN scored 0% of the average human score on Montezuma's Revenge, the only game in the original DQN work where it failed completely. - Simple exploration rarely yields rewards or reaches more than a few of the game's 24 rooms. - A 2016 count-based exploration bonus added to DQN reached 15 rooms and an average score of about 3.7K. - Later gains mostly relied on human demonstrations or access to the emulator's underlying state, rather than on exploration alone. ## Learning Without Extrinsic Rewards - The authors, with collaborators from UC Berkeley, studied agents trained with no environment-specific reward, using curiosity as the sole learning signal. - Earlier next-state prediction methods rewarded the prediction error of a learned model, which made agents attracted to unpredictable events. - Surprisingly, even predicting random features of the observation worked well. - Across more than 50 environments, curious agents showed a range of behaviors, and some achieved the game's objective without ever receiving the score as a reward: - **Breakout:** Intrinsic reward spiked on seeing new brick configurations and on first clearing a level. - **Pong:** An agent controlling both paddles kept long rallies going rather than trying to win. - **Bowling:** Agents outperformed those trained on the clipped extrinsic reward, likely because they were drawn to the hard-to-predict scoreboard flashes after strikes. - **Mario:** Agents discovered 11 levels, secret rooms, and bosses, since new areas are inherently unpredictable. ## The Noisy-TV Problem - Prediction-based curiosity can trap an agent in sources of randomness, such as a TV showing static, since such transitions always yield high reward. - The authors demonstrated this in a Unity maze with a TV playing random channels. - For largely deterministic games like Montezuma's Revenge, the problem was expected to matter less, but the team used sticky actions (repeating the previous action with some probability) to prevent memorization and make room transitions less predictable. ## How Random Network Distillation Works - The authors identified three sources of prediction error: (1) poor generalization from previously seen examples, which reflects novelty; (2) stochastic prediction targets; and (3) missing information or a predictor too limited for the target function. - Factor 1 is useful for measuring novelty, while Factors 2 and 3 cause the noisy-TV trap. - RND trains a predictor to match the output of a fixed, randomly initialized neural network on the next state. - Because the target is deterministic and the predictor shares the target's architecture, the predictor can fit it well in familiar states, so error stays low there and rises in novel states. - Intrinsic and extrinsic rewards are combined through a variant of PPO that uses two value heads, allowing different discount rates and mixing episodic and non-episodic returns. - The best agent often finds 22 of 24 rooms on the first level of Montezuma's Revenge and occasionally clears the level, with state-of-the-art results on Venture and Gravitar as well. ## Scale and Results on Montezuma's Revenge - A large run with 1024 rollout workers reached a mean return of 10K over 9 runs, with a best mean of 14.5K, and each run discovered 20 to 22 rooms. - A smaller, longer run produced one of 10 runs that scored 17.5K, passing the first level and finding all 24 rooms. - Implementation details mattered greatly: stabilizing features and normalizing intrinsic rewards separated an agent stuck in the first room from one that clears the first level, and fixing a bug where extrinsic returns were mistakenly treated as non-episodic produced noticeable gains. ## Future Directions The authors suggest analyzing and combining different exploration methods, training curious agents on many environments without reward to study transfer to tasks with rewards, and investigating global exploration with coordinated decisions over long horizons.

OpenAI2018-07-084 min readCurated summary

Glow: Better reversible generative models

# Glow: Reversible Generative Models with Invertible 1x1 Convolutions Glow is a reversible, flow-based generative model that simplifies the earlier RealNVP architecture by replacing fixed channel permutations with learned invertible 1x1 convolutions. The change yields significant log-likelihood gains on standard benchmarks while producing realistic high-resolution images and supporting efficient sampling. The authors argue that flow-based models, despite receiving far less attention than GANs and VAEs, offer exact inference, parallel synthesis, and a useful latent space for manipulating data. ## Why Flow-Based Models Are Worth Considering Generative models learn the structure of a dataset so they can produce outputs that resemble it, with applications in speech synthesis, text analysis, semi-supervised learning, and model-based control. Flow-based models, an extension of NICE and RealNVP, offer several advantages over alternatives: - **Exact inference and likelihood:** VAEs only approximate latent variables, and GANs have no encoder at all. Reversible models compute latents exactly and optimize the true log-likelihood rather than a lower bound. - **Efficient inference and synthesis:** Autoregressive models like PixelCNN are reversible but hard to parallelize for sampling. Flow-based models parallelize well for both directions. - **Useful latent spaces:** Reversible models and VAEs allow interpolation and meaningful edits of existing datapoints, which GANs and autoregressive models make difficult. - **Memory savings:** Gradients in reversible networks need memory constant in depth rather than linear, per the RevNet work. ## Benchmark Results Glow improves on RealNVP, the previous best flow-based result, on most benchmarks, measured in bits per dimension (lower is better): - CIFAR-10: 3.49 (RealNVP) vs. 3.55 (Glow), a slight regression - ImageNet 32x32: 4.28 vs. 4.09 - ImageNet 64x64: 3.98 vs. 3.81 - LSUN bedroom: 2.72 vs. 2.38 - LSUN tower: 2.81 vs. 2.46 - LSUN church outdoor: 3.08 vs. 2.67 Sampling a 256x256 image takes about 130ms on an NVIDIA 1080 Ti. Sampling from a reduced-temperature model (scaling latent standard deviation by 0.7) gives higher-quality samples. ## Latent Space Applications - **Interpolation:** Encoding two real face images and sampling intermediate points produces smooth transitions. Because the inputs are arbitrary faces rather than model samples, this suggests the model covers the full target distribution. - **Attribute manipulation:** The model trains without labels. Afterward, averaging latent encodings of inputs with and without an attribute (such as blonde hair) yields a direction vector that can shift new inputs toward that attribute. This needs only a small labeled set and no retraining, unlike GAN-based or Cycle-GAN approaches. ## Architectural Changes from RealNVP RealNVP alternates checkerboard-masked layers with channel-wise masked layers. Glow removes the checkerboard layers and changes the channel-wise layers in two ways: - **Learned 1x1 convolutions replace fixed permutations.** RealNVP's channel-wise coupling splits inputs into halves that update each other in a rigid bipartite pattern. Replacing the fixed reversal with a fixed shuffle improved performance, and learning the permutation improved it further. Since a permutation is a square linear transformation, it can be expressed as a 1x1 convolution and optimized with gradient descent. The weights start as a random rotation matrix and are efficiently computed via LU decomposition. - **Activation normalization replaces batch normalization.** This layer applies a learned per-channel shift and scale, initialized from a first minibatch. It allows a minibatch size of 1 for large images and lets the model scale up. ## Scaling Up Gradient checkpointing and other optimizations make training feasible at larger scale. The demo model was trained with Horovod across 5 machines of 8 GPUs each and has over 100 million parameters. ## Open Directions The authors identify two areas for future work: - **Likelihood competitiveness:** Autoregressive models and VAEs still score better on log-likelihood, but they sacrifice efficient sampling and exact inference, respectively. Combining these model families could capture the strengths of each. - **Efficiency:** The face model uses roughly 200M parameters and about 600 convolution layers, which is expensive to train. Shallower models learn long-range dependencies poorly, so self-attention or progressive training could reduce compute cost. Code and the paper are available on GitHub for anyone who wants to build on the work.

OpenAI2018-06-213 min readCurated summary

Retro Contest: Results

# OpenAI Retro Contest Results: Fast Learning and Generalization in Sonic The first OpenAI Retro Contest, which challenged participants to build reinforcement learning agents that generalize from prior experience, concluded with top results coming from tuned or extended versions of existing algorithms like PPO and Rainbow rather than contest-specific tricks. The best score reached 4,692 against a theoretical maximum of 10,000, which the author takes as evidence that the Sonic benchmark is a meaningful problem for the community to keep working on. The results also show that the winning approaches are general machine learning methods, so the benchmark cannot easily be gamed. ## Contest Scale and Evaluation Design - 923 teams registered over two months, and 229 submitted solutions to the leaderboard. - Automated systems ran 4,448 evaluations, about 20 submissions per team. - The public leaderboard used five low-quality levels built with a level editor. Because contestants saw scores and videos, they could overfit to it. - To prevent this, the final evaluation used 11 custom levels made by skilled level designers. The latest submission from each of the top 10 entrants was tested, with each agent run three times per level using different random seeds to reduce noise. - The ranking shifted only modestly in the final evaluation. ## Winning Approaches **Dharmaraja (1st, score 4,692)** - A variant of joint PPO with three main changes: RGB images instead of grayscale, a slightly larger action space with more common button combinations, and an augmented reward that favors visiting new states, judged by a perceptual hash of the screen. - Attempts that did not help included DeepMimic, YOLO-based object detection, and Sonic-specific heuristics. **Mistake (2nd, score 4,446)** - Built on the Rainbow baseline, with a tuned n-step value for n-step Q-learning, an extra CNN layer that slowed training but improved results, and a lower DQN target update interval. - Joint training with Rainbow reduced performance. The agent trained from scratch and timed out at 12 hours, which is why its learning curves end early. **Aborg (3rd, score 4,430)** - A solo effort building on joint PPO, adding more training levels from the Game Boy Advance and Master System Sonic games, a different network architecture, and hyperparameters tuned for fast fine-tuning. - The first 150K fine-tuning timesteps were unstable, so a learning rate adjustment fixed the performance drops. - Optimizers, MobileNetV2, and color images did not help. Dharmaraja and Aborg fine-tuned from a pre-trained network with PPO, while Mistake trained from scratch with Rainbow DQN. ## Awards for Write-ups and Community Support - **Best Write-up Prize** went to Dylan Djian, Oleg Mürk, and Felix Yu for essays describing the approaches they tried. - **Best Supporting Material** went to Tristan Sokol for tutorials, scripts, and a trajectory visualization tool that helped other contestants. ## Lessons and Next Steps - Several top solutions used transfer learning by fine-tuning from training levels, which the authors had expected. - Some top entries were simply well-tuned baseline algorithms, which underscores how much hyperparameters matter in RL, especially for Rainbow DQN. - Contests can challenge prevailing assumptions because many approaches get tried, but this one mostly confirmed what OpenAI already knew worked. - A second round is planned for a few months later, with the authors hoping more unconventional approaches will succeed.

OpenAI2018-05-153 min readCurated summary

AI and compute

# AI Compute Has Grown 300,000x Since 2012, and the Trend Shows No Sign of Stopping OpenAI's analysis finds that the compute used to train the largest AI models has doubled roughly every 3.4 months since 2012, far outpacing Moore's Law's two-year doubling period. The authors argue that compute is the most measurable driver of AI progress, that the trend is likely to continue for several more years given hardware innovation and economic incentives, and that policymakers and researchers should prepare now for systems far beyond current capabilities. An addendum extends the data back to 1959, revealing a second, slower era. ## How Compute Is Measured - The analysis counts actual neural net operations (adds and multiplies) used to train a single model, not peak hardware FLOPS or total datacenter capacity. - The unit is the petaflop/s-day (about 10²⁰ operations), a convenience similar to kW-hr for energy. - Per-model compute differs from total bulk compute because parallelism limits constrain how large a single training run can be. ## Four Eras of Training Compute - **Before 2012:** GPUs were rarely used for machine learning, so many results were hard to achieve at all. - **2012 to 2014:** Training across many GPUs was uncommon. Most results used 1 to 8 GPUs rated at 1 to 2 TFLOPS, totaling 0.001 to 0.1 pfs-days. - **2014 to 2016:** Large-scale runs used 10 to 100 GPUs rated at 5 to 10 TFLOPS, reaching 0.1 to 10 pfs-days. Data parallelism showed diminishing returns, limiting the value of bigger runs. - **2016 to 2017:** Techniques such as huge batch sizes, architecture search, and expert iteration, combined with TPUs and faster interconnects, raised those parallelism limits. AlphaGo Zero is the most visible example. ## Drivers of the Trend - The growth is roughly a 10x increase per year. - Custom hardware (GPUs and TPUs) delivers more operations per second per dollar. - Most of the growth came from researchers finding ways to use more chips in parallel and being willing to pay for them. ## Outlook and Limits - **Reasons to expect continuation:** AI-specific chip startups promise large gains in FLOPS per watt over one to two years. Recent algorithmic advances, such as architecture search and massively parallel SGD, could combine multiplicatively. - **Eventual constraints:** Cost will limit parallelism, and physics will limit chip efficiency. The largest training runs today use hardware costing single-digit millions of dollars, though amortized costs are lower. - **Room to grow:** Most neural net compute is spent on inference rather than training, so companies could repurpose large chip fleets for training. The world's total hardware budget is about $1 trillion per year, so absolute limits remain distant. - **Caveat:** The authors acknowledge that past trends cannot reliably predict how long growth will last or what will happen along the way. ## Addendum: Compute Across 1959 to 2012 - Extending the data back to the 1959 perceptron reveals two eras. From 1959 to 2012, compute roughly followed Moore's Law, with a doubling time of about two years. From 2012 onward, the 3.4-month doubling time dominates. - AI winters and booms had little visible effect on training compute over the past half-century. - Pre-2012 estimates are less precise, aiming for an order-of-magnitude accuracy rather than within a factor of 2 to 3. ## Implications The authors conclude that safety and malicious-use concerns need attention now, since capabilities could advance quickly. They also recommend that policymakers consider funding academic AI research, because some research is becoming too computationally expensive for universities to pursue without support.