# Merge and Branch: Efficient Tree-Structured Supervised Fine-Tuning of LLMs for Recommendation

DevFeed: [Merge and Branch: Efficient Tree-Structured Supervised Fine-Tuning of LLMs for Recommendation](<https://devfeed.tech/articles/merge-and-branch-efficient-tree-structured-supervised-fine-tuning-of-llms-for-recommendation-107998.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2610.37973>)

Author: Yunqin Zhu, Yao Xie

Published: 2026-10-30T04:00:00Z

Content type: article

Language: en

Sources: [arXiv: Artificial Intelligence](<https://devfeed.tech/sources/arxiv-artificial-intelligence.md>)

Topics: [Large Language Model](<https://devfeed.tech/topics/llm.md>), [Fine-tuning](<https://devfeed.tech/topics/fine-tuning.md>), [personalization](<https://devfeed.tech/topics/personalization.md>)

Tags: [cache](<https://devfeed.tech/tags/cache.md>), [cs-ai](<https://devfeed.tech/tags/cs-ai.md>), [cs-ir](<https://devfeed.tech/tags/cs-ir.md>), [decoding](<https://devfeed.tech/tags/decoding.md>), [efficiency](<https://devfeed.tech/tags/efficiency.md>), [efficiently](<https://devfeed.tech/tags/efficiently.md>), [encoding](<https://devfeed.tech/tags/encoding.md>), [experiments](<https://devfeed.tech/tags/experiments.md>), [fine-tuning](<https://devfeed.tech/tags/fine-tuning.md>), [flashattention](<https://devfeed.tech/tags/flashattention.md>), [generative](<https://devfeed.tech/tags/generative.md>), [history](<https://devfeed.tech/tags/history.md>), [independent](<https://devfeed.tech/tags/independent.md>), [input](<https://devfeed.tech/tags/input.md>), [interaction](<https://devfeed.tech/tags/interaction.md>), [key-value-cache](<https://devfeed.tech/tags/key-value-cache.md>), [layout](<https://devfeed.tech/tags/layout.md>), [llms](<https://devfeed.tech/tags/llms.md>), [multiple](<https://devfeed.tech/tags/multiple.md>), [public](<https://devfeed.tech/tags/public.md>), [recommendation](<https://devfeed.tech/tags/recommendation.md>), [structured](<https://devfeed.tech/tags/structured.md>)

## AI overview

Merge and Branch (M&B) makes supervised fine-tuning for generative recommendation more efficient by sharing computation over long interaction histories while learning from multiple target items. It compresses each historical item's semantic identifier and text into learned tokens, then arranges independent target predictions as branches in a shallow, wide tree. Tree FlashAttention processes the shared history once and propagates gradients from each branch; a tree-structured key/value cache carries history sharing into constrained decoding. The abstract reports that M&B outperforms strong recommendation baselines on public benchmarks and substantially improves training and decoding efficiency.

## Source excerpt

arXiv:2610.37973v1 Announce Type: cross Abstract: LLM-based generative recommendation reads long, text-rich interaction histories but generates only short semantic identifiers (SIDs). This asymmetry makes supervised fine-tuning inefficient: encoding the history is expensive, yet each history usually provides supervision for only one target. We present Merge and Branch (M&B) to reduce input cost and learn more from each encoded history. Merge compresses each historical item's SID and text into a small number of learned tokens. Branch uses the compressed history to predict multiple target SIDs. To share history computation while keeping these targets independent, M&B organizes each example as a shallow, wide tree. We develop tree FlashAttention to execute this layout efficiently, processing the shared history once and propagating gradients from every branch for end-to-end training. A tree-structured key/value cache extends history sharing to constrained decoding. Experiments on public benchmarks show that M&B outperforms strong recommendation baselines while substantially improving training and decoding efficiency.