Wiki: How to generate text without generation?

For agents: Markdown version · Wiki index · Explore

Written by an LLM from machine transcripts. It can contain errors. Check the transcript before you quote it.

Summary

This talk explores how to solve text editing and grammar correction problems efficiently without relying solely on slow, resource-intensive generative language models. The speaker shares a real-world project where the team needed a solution that was fast, high-quality, and cost-effective to handle millions of user requests in the background. By reformulating text generation as a sequence editing task using encoder-based architectures, they achieved a ten-fold speedup in runtime. The audience learns how to rethink task definitions and balance expressivity and cost in machine learning projects.

Key points

  • 0:00 The speaker introduces the topic of generating text without generation based on a real machine learning project.
  • 8:42 The baseline approach of using large language models is too slow and expensive for high-volume background features.
  • 9:55 Analyzing why generative decoder models are slow reveals that they generate text token by token without parallelization.
  • 14:21 Tasks like summarization, paraphrasing, and grammar correction can be reframed as editing tasks rather than pure generation.
  • 16:26 Method 1 uses a classification approach with encoder models to predict keep, delete, or insert actions in a single forward pass.
  • 18:29 Method 2 introduces predefined functions to handle more complex transformations without exploding the label space.
  • 21:39 Method 4 splits the problem into a detect-and-fill strategy using encoder models and masked language modeling.
  • 24:43 Re-framing the task definition allowed the team to improve runtime performance by ten times without sacrificing quality.

Takeaways

  • Reframe machine learning problems based on the relationship between input and output to unlock more efficient architectures.
  • Use encoder-based models for tasks like text correction to benefit from GPU parallelization instead of relying purely on generative decoders.
  • Balance expressivity and computational cost by breaking complex generation tasks into simpler classification and editing steps.

Questions this talk answers

  • How can I replace a slow generative large language model with a faster encoder-based model for text editing tasks?
  • What is the difference in computational efficiency between encoder and decoder models for sequence processing?
  • How do I formulate grammar correction as a classification problem instead of text generation?

Technologies

Python, PyTorch, GPT, Transformer

Tags

cost optimization, machine learning, nlp, performance, text generation, transformers