Skip to main content
QUICK REVIEW

[Paper Review] Adaptive Computation with Elastic Input Sequence

Fuzhao Xue, Valerii Likhosherstov|arXiv (Cornell University)|Jan 30, 2023
Advanced Neural Network ApplicationsComputer Science5 citations
TL;DR

AdaTape introduces a novel adaptive computation framework that uses a dynamic, learnable tape to generate elastic input sequences for Transformers, enabling both adaptive content and sequence length. It achieves state-of-the-art performance on image recognition tasks with compute-matched efficiency, outperforming standard and adaptive Transformers by leveraging a new Adaptive Tape Reading (ATR) mechanism that selects informative tokens from a tape bank.

ABSTRACT

Humans have the ability to adapt the type of information they use, the procedure they employ, and the amount of time they spend when solving problems. However, most standard neural networks have a fixed function type and computation budget regardless of the sample's nature or difficulty. Adaptivity is a powerful paradigm as it not only imbues practitioners with flexibility pertaining to the downstream usage of these models but can also serve as a powerful inductive bias for solving certain challenging classes of problems. In this work, we introduce a new approach called AdaTape, which allows for dynamic computation in neural networks through adaptive tape tokens. AdaTape utilizes an elastic input sequence by equipping an architecture with a dynamic read-and-write tape. Specifically, we adaptively generate input sequences using tape tokens obtained from a tape bank which can be either trainable or derived from input data. We examine the challenges and requirements to obtain dynamic sequence content and length, and propose the Adaptive Tape Reading (ATR) algorithm to achieve both goals. Through extensive experiments on image recognition tasks, we show that AdaTape can achieve better performance while maintaining the computational cost. To facilitate further research, we have released code at https://github.com/google-research/scenic.

Motivation & Objective

  • To address the limitation of fixed computation budgets in standard Transformers, which cannot adapt to input complexity.
  • To explore a new paradigm of adaptive computation through dynamic input sequence length and content, rather than model depth or sparse routing.
  • To provide a flexible, single-model solution that can scale computation during inference without retraining.
  • To demonstrate that adaptive input sequences can serve as a powerful inductive bias for solving hard problems like the vector parity task.

Proposed method

  • AdaTape introduces a tape bank of learnable or input-derived tokens that serve as a dynamic memory for each input sample.
  • It employs the Adaptive Tape Reading (ATR) algorithm to recursively select variable-length sequences of tape tokens based on input complexity.
  • The selected tape tokens are appended to the input sequence before being fed into a standard Transformer encoder.
  • ATR uses a halting mechanism to dynamically determine how many tape tokens to read, enabling variable computation per sample.
  • The tape bank can be either trainable or derived from input features (e.g., patch embeddings), enabling content adaptivity.
  • The method maintains computational efficiency by avoiding recursive model application or parameter sparsity, instead modifying input sequence structure.

Experimental results

Research questions

  • RQ1Can adaptive input sequence length and content improve model performance without increasing FLOPs?
  • RQ2Does the proposed AdaTape mechanism enable Transformers to solve tasks like vector parity that standard Transformers cannot?
  • RQ3How does AdaTape compare to existing adaptive methods in terms of inference speed and accuracy under compute constraints?
  • RQ4Can AdaTape maintain high performance while allowing dynamic computation scaling during inference across different hardware and batch sizes?

Key findings

  • AdaTape outperforms standard ViT and DeiT models on ImageNet-10-shot accuracy with comparable FLOPs, achieving a 2.3-point gain over non-adaptive baselines when content adaptivity is removed.
  • On the challenging vector parity task, AdaTape successfully solves the problem where vanilla Transformers fail, validating its inductive bias for hard tasks.
  • AdaTape-S/16 achieves faster inference than Tiny-level baselines despite higher capacity, demonstrating efficiency gains from dynamic sequence length.
  • Ablation studies show that removing content adaptivity causes a significant 2.3-point drop in ImageNet 10-shot accuracy, confirming its critical role in performance.
  • Larger AdaTape models show increased variance in sequence length, indicating better control over computation cost and improved adaptivity at scale.
  • Visualization confirms that AdaTape preferentially selects central, more informative image patches, aligning with human intuition about saliency.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.