Edit Flows: Flow Matching with Edit Operations

Marton Havasi, Brian Karrer, Itai Gat, Ricky T. Q. Chen
6/10/2025
cs.LGcs.AI

No official code found. Best implementation: TheMatrixMaster/edit-flows-demo (46 stars, MIT, last commit 2025-10-17).

Abstract

Autoregressive generative models naturally generate variable-length sequences, while non-autoregressive models struggle, often imposing rigid, token-wise structures. We propose Edit Flows, a non-autoregressive model that overcomes these limitations by defining a discrete flow over sequences through edit operations$\unicode{x2013}$insertions, deletions, and substitutions. By modeling these operations within a Continuous-time Markov Chain over the sequence space, Edit Flows enable flexible, position-relative generation that aligns more closely with the structure of sequence data. Our training method leverages an expanded state space with auxiliary variables, making the learning process efficient and tractable. Empirical results show that Edit Flows outperforms both autoregressive and mask models on image captioning and significantly outperforms the mask construction in text and code generation.

View on arXivView PDF

Code Implementations(1)

MIT

Educational Implementation of "Edit Flows: Flow Matching with Edit Operations" by Havasi et al.

462Shell, PythonJun 27, 20251 years agoMIT
diffusion-language-modelsdiffusion-llmdiscrete-flow-matchingflow-matchingmachine-learning

Similar Papers

Cite this paper

@article{havasi2025edit,
  title  = {Edit Flows: Flow Matching with Edit Operations},
  author = {Marton Havasi and Brian Karrer and Itai Gat and Ricky T. Q. Chen},
  year   = {2025},
  eprint = {2506.09018},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2506.09018v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2506.09018.svg)](https://codeofpaper.com/paper/2506.09018)

Discussion