Putting a shuffled set of sentences back into a coherent paragraph is a search over $N!$ orderings. The best neural systems for this task are trained to imitate the gold order one step at a time. They then fall apart on long inputs: perfect-reconstruction rates fall from about 92% on two-sentence abstracts to near zero at ten sentences (Neural Sentence Ordering). Reinforcement learning (RL), meaning training a model by sampling outputs and rewarding good ones, is the standard way to optimize whole-output quality measures such as "is the entire paragraph correct?". It is expensive, though. The model must generate each sampled output step by step inside the training loop, and the usual algorithms keep extra networks in memory: a critic, a reward model, and a frozen reference copy.
This note proposes a policy built so that both costs nearly disappear for permutation problems. One encoder pass over the sentence set produces two score tables: how likely each sentence is to open or close the paragraph, and how well each sentence follows each other sentence. Every sampled ordering, and its exact probability, then comes from cheap masked softmaxes over those tables, with no further network calls. A training batch can therefore draw hundreds of orderings per paragraph for roughly the price of one, and the group of samples supplies its own baseline, so no critic network is needed. Because the score structure is first-order (each sentence depends only on its predecessor), finding the single best ordering at test time is exactly the Asymmetric Traveling Salesman Problem (ATSP), a well-studied routing problem. Computing Locally Coherent Discourses showed this case solves to global optimality in under a second for up to 50 sentences. The complexity theory tells us which factorization keeps decoding exact. The RL-overhead literature tells us which factorization keeps training cheap. This proposal asks for one factorization that satisfies both.
Core Claim
Restrict the policy to a first-order structure whose logits are computed once per input. Then sequence-level RL for sentence ordering costs about the same as supervised training per update, and inference can be exact rather than greedy or beam-limited. The quality question is whether RL fine-tuning on paragraph-level rewards, applied on top of maximum-likelihood training, lifts perfect-match accuracy on long inputs ($N \ge 10$). That is the regime where pointer decoders hit the complexity wall. The compute claim is close to guaranteed by construction. The quality claim is the uncertain part, and the experiments are built to settle it.
Concretely, an encoder reads the unordered set $x$ of $N$ sentences jointly and outputs a start vector $s \in \mathbb{R}^N$, an end vector $e \in \mathbb{R}^N$, and a transition matrix $B \in \mathbb{R}^{N\times N}$. Here $B_{ij}$ scores sentence $j$ directly following sentence $i$. The policy over orderings $\sigma$ is
$$\pi(\sigma \mid x) = \prod_{t=1}^{N} \frac{\exp\big(B_{\sigma_{t-1}\sigma_t}\big)}{\sum_{j \notin \sigma_{<t}} \exp\big(B_{\sigma_{t-1} j}\big)},$$
where $\sigma_t$ is the sentence placed at position $t$, $\sigma_{<t}$ is the set already placed, and $B_{\sigma_0 j}$ is read as $s_j$. The end score $e$ is added to the final step as a separate term, so the model can express which sentence should close the paragraph. Sampling never touches the encoder again. Each sample is $N$ masked softmaxes over vectors of length $N$, and permutation validity holds by construction. The highest-scoring ordering under $s + B + e$ is an ATSP tour through a dummy start/end node. This is precisely the 2-place discourse ordering problem of Althaus et al., solved with their branch-and-cut integer program.
Relation to Prior Work
Three supervised lines of work supply the architecture and set the accuracy bar. Enhancing Pointer Network for Sentence Ordering with Pairwise Ordering Predictions adds pairwise look-ahead and history modules to an autoregressive pointer decoder. BERSON builds pairwise relations from BERT's next-sentence head into a relational pointer decoder. IRSE-GRN iteratively refines pairwise orderings on a sentence–entity graph. All three show that pairwise relations carry most of the signal, which motivates our transition matrix. All three still decode greedily or with beams and train only on next-step imitation. We keep the pairwise emphasis but change both the training signal (sequence-level reward) and the decoder (exact).
Non-Autoregressive Sentence Ordering (NAON) is the closest relative on the compute side. It predicts a position-by-sentence matrix in one parallel pass. Its outputs are not valid permutations, however: without its exclusive loss, repetition appears in 99% of test cases, and greedy matching is needed afterward. Its assignment-matrix distribution also has no tractable exact log-probability, so it cannot serve directly as a policy-gradient policy. Our factorization gives up NAON's position-specific scores, apart from the start and end bonuses. In exchange it gets exact sampling probabilities, guaranteed validity, and exact decoding.
On the RL side, Is Reinforcement Learning (Not) for Natural Language Processing identifies a huge per-step action space and in-loop generation as the sources of instability and cost; its NLPO method responds by masking unlikely tokens. Here the action space is at most $N$ by construction, so no masking is needed. PeRL uses random input permutations inside group-based RL and reports a constraint on this design: multiple permutations per sample break reuse of the attention key-value cache, which inflates cost. In PeRL, permutation is an input augmentation. In our setting, the permutation is the output, and all $K$ rollouts share one encoding exactly, so the cost PeRL hit does not arise. Teacher Forcing Recovers Reward Functions for Text Generation shows that a maximum-likelihood model's logits induce a dense per-step reward. We use it as a method source for one ablation: dense induced reward versus sparse sequence reward. ProRL shows that long RL runs pay off but cost about 16,000 H100 hours for a 1.5B model. That figure is the motivation for designing policies whose rollouts are cheap in the first place. Non-Monotonic Sequential Text Generation learns orderings by imitation with an annealed oracle. That approach depends on oracle access and on a projective tree constraint, both of which we avoid.
Research Program
The work has three parts.
First, we build the one-pass policy on a pretrained encoder. We use the same BERT-family backbone as BERSON so that the comparison is fair. Transitions come from a bilinear head over contextual sentence vectors, and start and end scores come from linear heads.
Second, we pretrain the policy by maximum likelihood of the gold ordering under the factorization above. This is cheap and exact. Then we fine-tune it with a critic-free group-baseline policy gradient. For each paragraph we draw $K$ orderings, with $K$ ranging from 8 to 512. The reward is a mix of Kendall's $\tau$ (rank correlation with the gold order) and an indicator for perfect match. Each sample's advantage is its reward minus the group mean. An optional KL penalty is computed against the maximum-likelihood checkpoint. Since $\pi$ is cheap, that penalty can be computed analytically on the sampled paths rather than by running a second network.
Third, we decode with exact ATSP branch-and-cut. We compare against greedy decoding and beam decoding under the same scores, which separates the gains from training from the gains from search.
A secondary arm tests arity. A second-order variant scores triples, so each sentence depends on its two predecessors. Sampling stays one-pass, but exact decoding becomes the generalized traveling salesman problem, which Althaus et al. found can take minutes on 20-sentence random instances. This arm measures what extra context buys and what exactness costs.
Baselines
The naive reference point is the same encoder trained by maximum likelihood under the first-order factorization and decoded greedily. Every gain we claim must be measured against this point, and it shares all architecture, data, and compute.
The strongest published systems are BERSON and IRSE-GRN, run from the released IRSEG code and the Pairwise code where available. BERSON reports a perfect match ratio (PMR) of 68.23% on ROCStory. IRSE-GRN reports Kendall's $\tau$ of 90.35 on NIPS and 91.11 on AAN abstracts. For NAON we found no specific reported numbers on Lacuna; the file only says it matches or exceeds prior systems. For SIND likewise we found no reported numbers on Lacuna. We will retrain these baselines on identical splits with the same backbone and the same hyperparameter-search budget. Beating them means higher PMR on ROCStory and arXiv overall, and in particular on the subset with $N \ge 10$. Matching them is the bar on short inputs.
The conventional RL competitor is an autoregressive pointer decoder (BERSON's decoder) fine-tuned with the same group-baseline objective and reward. It gets an equal GPU-hour budget, which in practice means far fewer samples per paragraph. This baseline shows whether our factorization buys quality per unit of compute or merely cheapness.
The ablation that isolates the key ingredient is the one-pass policy trained by maximum likelihood only and decoded exactly with ATSP. It is identical to our full method except that the RL fine-tuning stage is removed.
Why not just…?
Why not just train the pairwise scorer by maximum likelihood and decode it exactly with ATSP? This is the most serious threat. It is the Althaus recipe with neural edge weights, and it may capture most of the benefit. The ablation above runs exactly this. If RL fine-tuning adds less than about one point of PMR on long inputs, we will report the contribution honestly as "cheap exact decoding of a learned first-order model" and drop the RL quality claim. The argument for RL is specific: maximum likelihood trains each transition only on gold histories, while RL trains the scores on the policy's own sampled histories and on the global outcome that exact decoding actually optimizes.
Why not just use NAON's parallel decoder with its exclusive loss? NAON already has single-pass speed. However, its outputs need post-hoc matching to become valid orderings, and its distribution over orderings has no exact probability, so it cannot be fine-tuned with policy gradients without approximations. We will compare it directly on accuracy and wall-clock time. If NAON with greedy matching matches our exactly decoded policy on $N \ge 10$, the structural argument fails.
Why not just run standard RL on a pointer network? That is the conventional RL baseline above. The prediction is that, at an equal GPU budget, its far smaller effective sample count gives noisier advantage estimates and smaller gains. The measured throughput gap and the learning curves at matched wall-clock time will confirm or refute this.
Why not just prompt a large language model? NAON reports that zero-shot ChatGPT often drops or invents sentences when ordering. Our policy cannot do either by construction. We will include one prompted model as a reference point, not as a contender.
Proposed Experiments
The benchmarks are the arXiv abstracts, ROCStory, SIND, and the NIPS, NSF, and AAN abstract corpora, all with standard splits. The arXiv set provides the long-input stratum. Metrics are PMR, Kendall's $\tau$, and first- and last-sentence accuracy, all reported per length bucket. On the compute side we report samples per second, peak GPU memory, and wall-clock time to a fixed validation PMR.
The first decisive check is compute. Training cost per update should stay nearly flat as $K$ grows from 8 to 512 for our policy and grow linearly for the pointer-network RL baseline. We will report the measured ratio rather than assume it.
The second check is quality where it matters. On arXiv paragraphs with ten or more sentences, the full method must beat both the maximum-likelihood-plus-ATSP ablation and BERSON on PMR. Without that result the RL component is not justified.
The third check separates search from scoring. We cross every training method with greedy, beam, and exact decoding. This shows whether exact decoding helps only RL-trained scores, which would indicate that training and search interact, or helps all of them.
The final checks cover the remaining design choices. The dense induced reward from Teacher Forcing Recovers Reward Functions for Text Generation is compared against the sparse $\tau$ reward at equal sample counts. The second-order variant reports accuracy against decoding time, which tests whether the arity wall of Althaus et al. persists when the edge scores are learned.
References
- Neural Sentence Ordering
- Computing Locally Coherent Discourses
- Enhancing Pointer Network for Sentence Ordering with Pairwise Ordering Predictions
- BERT-enhanced Relational Sentence Ordering Network
- Improving Graph-based Sentence Ordering with Iteratively Predicted Pairwise Orderings
- Non-Autoregressive Sentence Ordering
- Is Reinforcement Learning (Not) for Natural Language Processing: Benchmarks, Baselines, and Building Blocks for Natural Language Policy Optimization
- PeRL: Permutation-Enhanced Reinforcement Learning for Interleaved Vision-Language Reasoning
- Teacher Forcing Recovers Reward Functions for Text Generation
- ProRL: Prolonged Reinforcement Learning Expands Reasoning Boundaries in Large Language Models
- Non-Monotonic Sequential Text Generation