techlist.io

OpenAI

274 posts

openai.com/news

Filter by tag

OpenAI2018-04-091 min readCurated summary

Gotta Learn Fast: A new benchmark for generalization in RL

This report introduces a new reinforcement learning benchmark built on the Sonic the Hedgehog video game franchise. The benchmark is designed to measure how well agents perform at transfer learning and few-shot learning, which test whether an agent can apply what it has learned in one setting to new ones with little additional training. The authors also evaluate baseline algorithms on the benchmark to establish reference performance. ## Benchmark Design - The benchmark is built on the Sonic the Hedgehog franchise, using its games as the training and evaluation environments. - It targets generalization, measuring how agents perform on levels or tasks they have not seen before. ## Evaluation Focus - Transfer learning: how well knowledge from previously learned tasks carries over to new ones. - Few-shot learning: how quickly an agent adapts to a new task from only a small amount of experience. - Baseline algorithms are evaluated on the benchmark to give future work a point of comparison. ## Research Areas - The work falls under exploration and games, as well as learning paradigms in RL.

OpenAI2018-04-043 min readCurated summary

Retro Contest

# OpenAI's Retro Contest: Testing RL Generalization on Unseen Game Levels OpenAI launched the Retro Contest to measure whether reinforcement learning algorithms can generalize from prior experience rather than memorize a single environment. Contestants train on known Sonic the Hedgehog levels and are evaluated on custom levels they have never seen. Baseline results show that current RL algorithms fall well short of human performance, even with transfer learning, which nearly doubled PPO's score in the authors' experiments. The post also introduces Gym Retro, a platform for turning classic games into RL environments. ## Why Conventional RL Evaluation Falls Short - Typical RL research tests algorithms in the same environment used for training. - This setup rewards memorization and favors algorithms with many hyperparameters that can be tuned to a specific task. - The contest instead evaluates agents on previously unseen levels, which measures generalization. ## Contest Design and Baseline Results - The contest runs from April 5 to June 5, 2018. - Contestants receive a training set of Sonic the Hedgehog levels, while the test set consists of custom levels created for the contest. - At test time, agents get about 18 hours of gameplay (1 million timesteps) per never-before-seen level. Existing algorithms perform far below humans even with this budget. - Baselines include Rainbow DQN, PPO, and JERK, a simple random-action search optimized for Sonic that replays its top-scoring action sequences. - Pre-training PPO on the training levels and fine-tuning on the test levels nearly doubled its performance, making it stronger than the other baselines. The authors note this shows transfer learning can have a large and reliable effect. - Humans still substantially outperform all algorithms. Humans trained for about two hours and played each test level for one hour, compared with 18 hours for the algorithms. - The technical report "Gotta Learn Fast" describes the benchmark in detail, and the retro-baselines repository shows how to run the algorithms on the contest tasks. ## Sonic Recordings Dataset - The team released recordings of humans completing the contest's Sonic levels. - These recordings can be used to start agents from random points along each level, which exposes them to areas they would rarely reach from the beginning. - Researchers can also use the recordings to train agents from demonstrations. ## Gym Retro - Gym Retro wraps classic video games as RL environments. The beta includes 30 SEGA Genesis games and 62 Atari 2600 games from the Arcade Learning Environment. - Genesis games suit transfer learning because levels share physics and object appearances while differing in layout and items. They are also more complex than Atari games, with over 500 times the RAM and a wider range of control inputs. - Environments are defined through JSON files rather than C++ code, which makes adding new games easier than in the Retro Learning Environment. - Compared with Universe, Gym Retro runs environments synchronously, can run faster than real time, and detects game state from memory rather than screen-based detection, which the authors found unreliable.

OpenAI2018-03-192 min readCurated summary

Variance reduction for policy gradient with action-dependent factorized baselines

Policy gradient methods work well in deep reinforcement learning, but their gradient estimates have high variance, especially in long-horizon tasks and those with high-dimensional action spaces. This post derives a bias-free, action-dependent baseline that uses the structure of the stochastic policy without adding assumptions about the MDP. The authors show through theory and experiments that it reduces variance and speeds learning, and that it scales to high-dimensional control. ## The Variance Problem in Policy Gradients - Policy gradient estimates often vary widely between samples, which slows and destabilizes learning. - The problem worsens as the horizon grows or the action space becomes higher-dimensional. ## An Action-Dependent, Bias-Free Baseline - The baseline depends on the action as well as the state, going beyond the conventional state-dependent baselines. - It exploits the factorized form of the stochastic policy itself, so it needs no additional assumptions about the environment. - The method stays computationally efficient, which makes it practical for large problems. ## Theoretical and Empirical Results - The authors quantify the variance benefit of the action-dependent baseline analytically. - They also analyze how suboptimal the optimal state-dependent baseline is, which shows the gap the new baseline closes. - On standard RL benchmarks and high-dimensional hand manipulation tasks, the action-dependent baseline yields faster learning. ## Scaling and Extensions - The approach scales to a synthetic 2000-dimensional target matching task. - The general idea of adding extra information to baselines also extends to partially observed and multi-agent settings. For practitioners facing high-dimensional action spaces or long horizons, the post suggests that an action-dependent factorized baseline is a low-cost way to reduce gradient variance without introducing bias.

OpenAI2018-03-141 min readCurated summary

Improving GANs using optimal transport

The paper introduces OT-GAN, a variant of generative adversarial networks that minimizes a new distance measure between the generator's distribution and the data distribution. This measure, called mini-batch energy distance, combines optimal transport in primal form with an energy distance computed in an adversarially learned feature space. The authors report that OT-GAN is highly stable with large mini-batches and achieves state-of-the-art results on several popular image generation benchmarks. ## A New Training Metric: Mini-batch Energy Distance - Measures the distance between the generator and data distributions - Combines optimal transport (primal form) with an energy distance - Computes the energy distance in a feature space that is learned adversarially - Produces a highly discriminative distance function with unbiased mini-batch gradients ## Stability at Large Batch Sizes - Training remains stable when using large mini-batches, which is often a challenge for GANs ## Image Generation Results - Achieves state-of-the-art performance on several popular image generation benchmarks This summary is based on the abstract alone. The post does not include the method details, experimental setup, or quantitative comparisons, so those would need to be read in the full paper.

OpenAI2018-03-072 min readCurated summary

On first-order meta-learning algorithms

This paper studies meta-learning, where an agent is trained on a distribution of tasks so that it can learn a previously unseen task from the same distribution quickly. The authors analyze a family of algorithms that learns a parameter initialization fine-tunable on new tasks using only first-order derivatives. This family includes first-order MAML and Reptile, a new algorithm the authors introduce. The paper extends earlier results showing these first-order methods perform well on few-shot classification benchmarks, and it offers theoretical analysis of why they work. ### Problem Setting - A meta-learner is trained over a distribution of tasks. - The goal is an initialization that adapts quickly, so the agent performs well on an unseen task after only a few gradient steps. ### First-Order Meta-Learning Algorithms - The family analyzed uses only first-order derivatives in its meta-updates. - It includes first-order MAML, which approximates MAML by dropping second-order derivative terms. - It generalizes these first-order methods within a single analytical framework. ### Reptile - Reptile repeatedly samples a task, trains on it, and moves the initialization toward the weights obtained on that task. - It is a first-order method, so it avoids the cost of computing second-order derivatives. ### Empirical and Theoretical Findings - The results extend Finn et al. and show that first-order methods perform well on established few-shot classification benchmarks. - The authors provide theoretical analysis aimed at explaining why these first-order algorithms succeed.

OpenAI2018-03-063 min readCurated summary

Reptile: A scalable meta-learning algorithm

# Reptile: A Simple, Scalable Meta-Learning Algorithm Reptile is a meta-learning algorithm that finds a neural network initialization from which new tasks can be learned quickly from few examples. It works by repeatedly sampling a task, running standard SGD on it, and moving the initial parameters toward the adapted result. Mathematically it resembles first-order MAML, but it needs only black-box access to an optimizer such as SGD or Adam, and it achieves similar performance with lower computational cost. ## Meta-Learning and the Few-Shot Setting - Meta-learning takes a distribution of tasks, each a learning problem, and produces a learner that generalizes from a small number of examples. - A well-studied case is few-shot classification, where the learner sees only 1–5 examples per class before classifying new inputs. ## How Reptile Differs from MAML - MAML unrolls and differentiates through the gradient descent computation graph, which requires second derivatives. - Reptile runs ordinary SGD on each task and never builds a computation graph or computes second derivatives, so it uses less computation and memory. - The update moves the initialization toward the task-adapted parameters. Treating that difference as a gradient allows plugging it into a more sophisticated optimizer such as Adam. ## Why It Works - With one SGD step per task (k=1), the method reduces to joint training on the mixture of all tasks. Joint training learns little when zero-shot learning is impossible, such as when output labels are randomly permuted. - Reptile requires multiple steps (k>1), where the update depends on higher-order derivatives of the loss. - A Taylor-series analysis shows that the Reptile update maximizes the inner product between gradients from different minibatches of the same task, which corresponds to better generalization. The authors suggest this may also help explain the generalization of SGD outside meta-learning. - Reptile and MAML produce similar updates, containing the same two terms with different weights. ## Experimental Results - On the Omniglot and Mini-ImageNet few-shot classification benchmarks, Reptile and MAML perform similarly. - Reptile converges faster because its update has lower variance. - Summing different combinations of SGD minibatch gradients yields a family of algorithms. Using only the second gradient corresponds to first-order MAML. Including more gradients speeds learning through variance reduction, and using only the first gradient makes no progress, as the analysis predicts. ## Implementations - The official implementation uses TensorFlow and includes code to replicate the Omniglot and Mini-ImageNet experiments. - A smaller JavaScript implementation fine-tunes a TensorFlow-pretrained model and powers the interactive 1-shot classification demo. - A minimal PyTorch example performs few-shot regression on random sine waves from 10 (x, y) pairs. ## Relationship to Prior Work The authors note that first-order MAML and Reptile are more closely related than the names suggest. They take different perspectives but compute similar updates. Reptile's contribution builds on Shortest Descent and on avoiding second derivatives in meta-learning. The post's first paragraph was updated to reflect this.

OpenAI2018-03-021 min readCurated summary

Some considerations on learning to explore via meta-reinforcement learning

This post proposes two meta-reinforcement learning algorithms, E-MAML and E-RL², designed to improve exploration. The authors argue that standard meta-RL methods often fail when an agent must actively explore to find useful information, and they show that both algorithms perform better on tasks where exploration matters. ## Proposed Algorithms - **E-MAML** extends Model-Agnostic Meta-Learning (MAML) to encourage exploration. - **E-RL²** extends RL² (Fast Reinforcement Learning via Slow Reinforcement Learning) with the same goal. ## Evaluation Environments - **Krazy World**: a novel environment the authors created to test exploration. - **Maze environments**: a set of maze tasks where finding the goal requires exploring unfamiliar layouts. ## Results - Both E-MAML and E-RL² outperform their baselines on tasks where exploration is important.

OpenAI2018-02-251 min readCurated summary

Multi-Goal Reinforcement Learning: Challenging robotics environments and request for research

This technical report introduces a suite of challenging continuous control benchmarks for robotics, built on existing hardware and integrated with OpenAI Gym. It also argues for further research into reinforcement learning (RL) methods, especially multi-goal RL and Hindsight Experience Replay. ## Robotics Benchmark Suite - The tasks use a Fetch robotic arm for pushing, sliding, and pick-and-place. - They use a Shadow Dexterous Hand for in-hand object manipulation. - Every task has sparse binary rewards, so the agent receives feedback only on success or failure. - The tasks follow a Multi-Goal RL framework, in which the agent receives an additional input specifying what it should accomplish. ## Research Directions - The second part of the report proposes concrete ideas for improving RL algorithms. - Most of these ideas relate to multi-goal RL and Hindsight Experience Replay, a technique that relabels failed attempts with the goals they actually achieved so the agent can learn from them.

OpenAI2018-02-253 min readCurated summary

Ingredients for robotics research

# Ingredients for robotics research OpenAI's robotics team released eight simulated robotics environments for Gym, built on the MuJoCo physics simulator, along with a Baselines implementation of Hindsight Experience Replay (HER). The environments are substantially harder than the existing MuJoCo continuous control tasks and use realistic models of real robots, and HER makes it possible to learn them from sparse rewards alone. The post also lists a set of open research directions for extending HER. ## Environments - Eight tasks in total: four using the Fetch research platform and four using the ShadowHand robot. - Tasks are goal-based, such as sliding a puck to a target position or rotating a block to a desired orientation. - The default reward is sparse: -1 until the goal is reached (within a tolerance), then 0. A dense-reward variant is also included, but the authors recommend the sparse version as more realistic for robotics. - The environments were used to train models that work on physical robots. ## Hindsight Experience Replay - Standard RL algorithms learn little from failed attempts when every reward is the same constant (-1). - HER relabels failed episodes by treating the goal the agent actually achieved as if it were the intended goal, which gives a useful learning signal. - Replaying these relabeled experiences with goals chosen after the episode ends is what gives the method its name. - HER works with any off-policy algorithm, such as DDPG (written as "DDPG + HER"). ## Results - On the new tasks, DDPG + HER substantially outperforms vanilla DDPG, which mostly fails to learn. - DDPG + HER with sparse rewards performs best. It learns a successful policy on HandManipulateBlockRotateXYZ from sparse rewards alone. - DDPG + HER with dense rewards learns but reaches lower performance, a trend the authors report as generally true across environments. - Full results are in the accompanying technical report. ## Open Research Directions The authors propose several extensions: - **Automatic hindsight goal creation:** learning the goal-substitution strategy instead of hard-coding it. - **Unbiased HER:** goal substitution distorts the experience distribution, which could be corrected with importance sampling. - **HER + hierarchical RL:** applying substitution to a higher-level policy's actions or subgoals. - **Richer value functions:** conditioning on inputs such as discount factor or success threshold. - **Faster information propagation:** alternatives to target networks, which slow training. - **HER + multi-step returns:** difficult today because the relabeled experience is highly off-policy. - **On-policy HER:** combining HER with stable on-policy algorithms like PPO, possibly via importance sampling. - **RL with very frequent actions:** designing algorithms that keep their performance as the action frequency increases. - **Combining HER with recent RL advances:** such as prioritized experience replay, distributional RL, entropy regularization, or reverse curriculum generation. ## Using the Environments - Goal-based environments use a `gym.spaces.Dict` observation space with three keys: `desired_goal`, `achieved_goal`, and `observation`. - The reward function is exposed, so rewards can be recomputed for substituted goals, which HER-style algorithms require. - Existing Gym-compatible algorithms such as Baselines can use these environments after flattening the dict observation with `gym.wrappers.FlattenDictWrapper`.

OpenAI2018-02-143 min readCurated summary

Interpretable machine learning through teaching

# Teaching AIs to Explain Themselves Through Examples The post introduces a machine teaching method in which one neural network learns to select examples that help another network understand a concept, and those examples remain interpretable to humans. The authors show that this approach works across several concept types and that human subjects guess concepts more accurately when taught with the selected examples than with random ones. The core idea is that agents trained jointly tend to invent private codes that humans cannot read, whereas a teacher grounded in a separately trained student produces explanations that stay meaningful. ## Why Cooperative Communication Matters - Powerful AI systems will often need to collaborate with humans, which requires a shared language. - Learning from well-chosen examples is far faster than learning from random ones. For instance, identifying a rectangle is easier when shown its corners than when shown random points inside it. - The method frames communication as a cooperative game between a student agent, which must guess a concept, and a teacher agent, which must choose examples that convey it. ## Two-Stage Teaching Process - **Stage one:** The student network receives randomly selected labeled examples and trains with standard supervised learning to predict concept labels. - **Stage two:** The teacher, which knows the intended concept and the true labels, tests candidate examples on the student and observes its predictions. Over time it converges on the smallest set of examples that lets the student identify the intended concept. - Because the teacher works through a student that is already tied to human-defined concepts, the chosen examples remain grounded and interpretable. ## The Problem with Joint Training - When student and teacher are trained together, as in many current communication games, they can develop a private protocol. - Such protocols can be arbitrary. A "dog" might be encoded by a set of vectors that look like llamas and motorcycles to a person, and a rectangle might be encoded by two dots that appear random but precisely specify its dimensions. ## How the Teacher Reasons - The experiments used images varying in four properties: size (small, medium, large), color (red, blue, green), shape (square or circle), and border (solid or none). - A concept is a set of required properties, and the teacher selects examples that share only those properties so the student can rule out irrelevant ones. - For example, to teach "red," the teacher might show a large red square without a border and a small red circle with a border. These share only the color red, so the student infers that red is the concept. ## Results - The method worked across boolean, hierarchical, probabilistic, and rule-based concepts. - The strategies the teacher discovered often matched those that humans would design. - Human participants recruited through Mechanical Turk identified the correct concept more often when taught with the teacher's examples than when shown random examples. ## Scope and Future Directions - The work studied teaching only through examples, but the same principles could support interpretable communication between agents more broadly.

OpenAI2018-02-063 min readCurated summary

Discovering types for entity disambiguation

# Discovering Types for Entity Disambiguation OpenAI's approach to entity disambiguation replaces direct reasoning about which object a word refers to with a "20 questions" game over roughly 100 automatically discovered categories. A neural network predicts whether a word in context belongs to each type, and Bayes' theorem then narrows the candidate entities. The method reaches new state-of-the-art accuracy on CoNLL (YAGO) and TAC KBP 2010, and the authors note that near-perfect type prediction would push accuracy close to 99%. ## Building the Type System - Every Wikipedia-internal link is treated as evidence that the link text can refer to the linked entity (e.g., [jaguar] pointing to the Jaguar animal page). - The Wikipedia category tree, via the Wikidata knowledge graph, assigns each entity a set of categories. - Around 100 categories are selected as the type system, so each entity becomes a ~100-dimensional binary vector of category memberships. - A neural network is trained on words plus context to predict these binary vectors, chaining together the link data, category memberships, and chosen types. ## Probabilistic 20 Questions at Inference - The network's outputs are read as per-category probabilities for the word. - If the category memberships were known exactly, the entity would be identified. Since they are not, Bayes' theorem computes the probability of each candidate entity. ## Cleaning the Training Data - Wikidata's "instance of" relation is applied recursively to assign types, for example marking any descendant of "human" as a human. - Raw link statistics are noisy because of anaphora (linking "king" to Charles I) and metonymy (linking a nickname to the band). For instance, "king" had 974 candidate entities, and "queen" linked to the band Queen 4,920 times but to "monarch" only 32 times. - Rather than pruning rare links, the authors map links to their generic meanings using Wikidata's property graph. After this, "king" has 14 candidate entities, and links from "queen" to "monarch" rise from 32 to 3,553. ## Searching for a Good Type System - The search space is too large for exact solutions, so the authors use heuristic search and evolutionary optimization, with gradient descent to train the type classifier. - Good types must be discriminating (they narrow down candidates) and learnable (context reveals them). - Two heuristics guide the search: learnability, measured by the AUC of a classifier predicting each type, and oracle accuracy, the disambiguation accuracy achievable with perfect type predictions. - Learnability scores come from a smaller proxy model that trains in about 2.5 seconds, since the full model takes several days. - Types with low learnability, such as ISBN numbers, tend to be unnatural categories that context does not predict well. ## Neural Type Classifier and Inference - A bidirectional LSTM trained on about 400M tokens each for English and French predicts type membership per word, reaching an F1 above 0.91. - The selected type system includes categories such as Aviation, Clothing, Games, and the very specific "1754 in Canada," which reflects the small 1,000-article training set used for the search. - Coherence-based methods compare entities pairwise at O(N²) cost in document length. This approach runs in O(N) by looking up phrases in a trie, ranking candidates by Wikipedia link frequency weighted by type-classifier likelihood. - New entities can be added by specifying their type memberships alone. ## Limitations and Future Work - The authors plan to compare this type-based inference with end-to-end learned distributed representations. - The type system was discovered on a small Wikipedia subset, and scaling to all of Wikipedia could produce a more broadly applicable set of types.

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.

OpenAI2018-01-175 min readCurated summary

Scaling Kubernetes to 2,500 nodes

# Scaling Kubernetes to 2,500 Nodes for Deep Learning OpenAI's deep learning research team ran Kubernetes for over two years and pushed one cluster to more than 2,500 nodes on Azure, mixing D15v2 and NC24 VMs. Along the way, nearly every major system component broke, including etcd, the kube-apiservers, Docker image pulls, networking, KubeDNS, and the ARP cache. The post walks through each failure and the specific fix, with the common theme that most problems came from default settings that did not hold up at scale. ## etcd Performance and Storage Limits - Past 500 nodes, researchers saw frequent kubectl timeouts. Adding more kube-apiserver replicas helped temporarily but stopped working past 10 replicas, which pointed to the real bottleneck: etcd. - etcd write latency spiked to hundreds of milliseconds on network-attached P30 SSDs. Benchmarking with fio showed etcd used only about 10% of the disk's IOPS because its sequential writes were latency-bound at 2ms. - Moving the etcd data directory to the instance's local SSD dropped write latency to 200µs and restored health. - Past 1,000 nodes, the apiservers were reading over 500MB/s from etcd. Prometheus monitoring and audit logs (`--audit-log-path`, `--audit-log-maxbackup`) revealed slow queries and heavy LIST calls on Events. - The root cause was Fluentd and Datadog querying the apiservers from every node. The team reduced their polling frequency, which stabilized apiserver load. - Events were moved to a separate etcd cluster using `--etcd-servers-overrides`, so bursts of Event creation would not affect the main cluster. - Hitting etcd's default 2GB storage limit stopped all writes, which made nodes fail health checks and caused the autoscaler to terminate workers. The fix was raising `--quota-backend-bytes`, and the autoscaler gained a safeguard that refuses to act if it would remove more than 50% of the cluster. ## Kube Master Configuration - The kube-apiserver, kube-controller-manager, and kube-scheduler run colocated on at least two master machines for high availability. `--apiserver-count` is set explicitly so Prometheus does not confuse instances. - Because the cluster is mainly used for batch workloads with autoscaling, the team reversed the default scheduler behavior. Instead of spreading pods evenly, they packed them using `MostRequestedPriority` and `InterPodAffinityPriority`, which lets idle nodes be terminated and leaves room for large pods. ## KubeDNS Hotspots - The new packing policy placed 10+ KubeDNS replicas on some machines. These hotspots exceeded the roughly 200 QPS per-VM limit Azure enforces on external DNS lookups. - The fix was a `podAntiAffinity` rule with `kubernetes.io/hostname` as the topology key, which spreads KubeDNS pods across different nodes. ## Docker Image Pulls - The Dota image is about 17GB and took around 30 minutes to pull on a fresh node. Because kubelet's `--serialize-image-pulls` defaults to true, that single pull blocked every other image on the node. - Setting it to false required switching Docker's storage driver from AUFS to overlay2. The Docker root was also moved to the local SSD to speed up pulls. - Large pulls were being canceled for lack of progress (`net/http: request canceled`). The team raised `--image-pull-progress-deadline` to 30 minutes and set Docker's `max-concurrent-downloads` to 10 to process the backlog in parallel. - Nodes reaching gcr.io through a NAT were hitting per-IP quota limits on the pause container image, which blocked all container starts. The fix was preloading that image, along with a whitelist of common internal images, into the worker machine image using `docker image save` and `docker image load`. ## Networking Overhead - Direct machine-to-machine throughput was 10–15 Gbit/s, but pods on Flannel reached only about 2 Gbit/s on Azure. Flannel did not show this overhead on the team's physical machines, so the cause was environmental rather than misconfiguration. - The workaround is `hostNetwork: true` with `dnsPolicy: ClusterFirstWithHostNet`, which bypasses Flannel for specific pods. The post cautions readers to review the Kubernetes documentation's warnings before using it. ## ARP Cache Exhaustion - Intermittent DNS failures and multi-second connection delays on a Redis host traced back to the kernel's ARP neighbor table. The dmesg log reported `neighbor table overflow!`. - Every pod has its own IP address, so pods consume ARP entries quickly. The fix was raising `net.ipv4.neigh.default.gc_thresh1`, `gc_thresh2`, and `gc_thresh3` in `/etc/sysctl.conf` to 8000, 9000, and 100000. This is a common tuning step in HPC clusters. ## Practical Takeaway Scaling Kubernetes well past typical sizes depends less on any single fix than on checking default behavior at every layer: monitoring polling, storage latency, image pull settings, scheduler policy, DNS placement, and kernel networking limits. The team reported the clusters ran incident-free for about three months after these changes, and they had upgraded to Kubernetes 1.8.4, which officially supported 5,000 nodes.

OpenAI2017-12-053 min readCurated summary

Block-sparse GPU kernels

# Block-Sparse GPU Kernels for Neural Networks OpenAI releases highly optimized GPU kernels for neural networks whose weight matrices are block-sparse, meaning most blocks are exactly zero. Depending on the sparsity level, these kernels run orders of magnitude faster than cuBLAS or cuSPARSE, and the authors use them to reach state-of-the-art results in text sentiment analysis and in generative modeling of text and images. The post presents the kernels as a promising but not definitive foundation, and invites the community to explore the architectures they make practical. ## Why Sparse Weights Matter - Sparse weight matrices contain a large number of entries exactly equal to zero. - Matrix multiplication and convolution with block-sparse weights cost only in proportion to the number of non-zero blocks. - For a fixed parameter and compute budget, sparsity allows much wider and deeper networks, such as LSTMs with tens of thousands of hidden units, while the largest LSTMs trained at the time had only thousands. ## The Kernels - They support block-sparse weights in both fully connected and convolutional layers. - In convolutional layers, sparsity applies to input and output feature dimensions, while spatial connectivity is unchanged. - Sparsity is defined per block, with kernels optimized for 8x8, 16x16, and 32x32 blocks. The block-level pattern is fully configurable. - Skipped zero blocks mean compute and parameter storage scale with the number of non-zero weights rather than the number of input and output features. - Benchmarks on a Titan X Pascal GPU (CUDA 8), with 12288 hidden units, 32x32 blocks, and minibatch size 32, show speed-ups over cuBLAS at various sparsity levels. Speed-ups over cuSPARSE were even larger. ## Using the Kernels - The post includes a TensorFlow example that creates a random block-level sparsity pattern, builds a `BlocksparseMatMul` object with a chosen block size, initializes block-sparse weights from `bsmm.w_shape`, and runs the multiplication as a graph operation. ## Small-World LSTMs - Small-world graphs connect any two nodes through a small number of steps, even at very large scale, and brain connectivity shows similar properties. - The authors hypothesized that small-world sparse connectivity keeps information propagating quickly despite high sparsity. - Using this structure, they trained LSTMs with nearly 20,000 hidden units, about 5 times wider than a dense network with similar parameter counts, improving results on text generation and semi-supervised sentiment classification. ## Results - **Sentiment:** Using the setup from their sentiment neuron experiment, the sparse model beat the dense model on all sentiment datasets. On the document-level IMDB dataset, error dropped from 5.91% (Miyato et al., 2016) to 5.01%, a state-of-the-art result. Previous results had only performed best on shorter sentence-level datasets. - **Text compression:** With equal parameter counts (about 100 million), bits-per-character fell from 1.059 to 1.048 using sparse, wide LSTMs. - **Images:** Replacing regular 2D convolutions with sparse kernels in PixelCNN++ on CIFAR-10, while deepening the network and keeping other hyperparameters fixed, reduced bits-per-dimension from 2.92 to 2.90, a new state of the art on that dataset. ## Open Research Directions - **Inference speed-up:** How much wall-clock speed-up can pruning after training achieve when combined with these kernels? - **Learning sparsity structure:** Can gradients learn the sparsity pattern as well as the weights, similar to how biological brains partly determine connectivity during development? Related work includes learning block-sparse RNNs and L0 regularization. - **Application domains:** Sparse layers allow huge weight matrices at the same parameter count and compute cost as smaller dense models. Which domains will benefit most?

OpenAI2017-12-032 min readCurated summary

Learning sparse neural networks through L₀ regularization

This paper proposes a practical way to apply L₀ norm regularization to neural networks, pruning the network during training by pushing weights to become exactly zero. The authors argue this can speed up training and inference and improve generalization. Because the L₀ norm is non-differentiable, they make it trainable by attaching stochastic gates to the weights and optimizing the gate distributions jointly with the network parameters using standard stochastic gradient descent. ## Why L₀ Regularization Is Hard to Apply - Exact sparsity is attractive because it corresponds to model selection, and AIC and BIC are special cases of L₀ regularization. - The L₀ norm of the weights is non-differentiable, so it cannot be added directly to the objective function as a regularization term. ## Stochastic Gates as a Workaround - A collection of non-negative stochastic gates determines which weights are set to zero. - For certain gate distributions, the expected L₀ norm of the gated weights is differentiable with respect to the distribution parameters, which makes it usable in gradient-based training. - The gate distribution is a "hard concrete" distribution, built by stretching a binary concrete distribution and passing its samples through a hard-sigmoid. ## Benefits of the Approach - Model structure can be learned with ordinary stochastic gradient descent, without a separate pruning stage. - Conditional computation can be handled in a principled way, since gated-off weights need not be computed. - The authors report experiments showing the effectiveness of both the approach and the regularizer, though the excerpt does not include their specific results.