ActionPiece: Contextually Tokenizing Action Sequences for Generative Recommendation
Authors: Yupeng Hou
Jianmo Ni
Zhankui He
Noveen Sachdeva
Wang-Cheng Kang
Ed H. Chi
Julian McAuley
Derek Zhiyuan Cheng
Venue: ICML 2025 spotlightposter (2025)
Keywords: Generative Recommendation
Action Tokenization
Primary area: deep_learning->other_representation_learning
TL;DR: We propose ActionPiece, the first context-aware action sequence tokenizer for generative recommendation, which can tokenize the same action into different tokens based on the surrounding context in different sequences.

Abstract: Generative recommendation (GR) is an emerging paradigm where user actions are tokenized into discrete token patterns and autoregressively generated as predictions. However, existing GR models tokenize each action independently, assigning the same fixed tokens to identical actions across all sequences without considering contextual relationships. This lack of context-awareness can lead to suboptimal performance, as the same action may hold different meanings depending on its surrounding context. To address this issue, we propose ActionPiece to explicitly incorporate context when tokenizing action sequences. In ActionPiece, each action is represented as a *set* of item features. Given the action sequence corpora, we construct the vocabulary by merging feature patterns as new tokens, based on their co-occurrence frequency both within individual sets and across adjacent sets. Considering the unordered nature of feature sets, we further introduce set permutation regularization, which produces multiple segmentations of action sequences with the same semantics. Our code is available at: https://github.com/google-deepmind/action_piece.

ActionPiece: Contextually Tokenizing Action Sequences for Generative Recommendation
Yupeng Hou
Jianmo Ni Zhankui He Noveen Sachdeva Wang-Cheng Kang²
Ed H. Chi Julian McAuley'
Derek Zhiyuan Cheng?
Abstract
345
284
foature
Action
unondered
Generative recommendation (GR) is an emerg- ing paradigm where user actions are tokenized into discrete token patterns and autoregressively generated as predictions. However, existing GR models tokenize each action independently, as- signing the same fixed tokens to identical ac- tions across all sequences without considering contextual relationships. This lack of context- awareness can lead to suboptimal performance. as the same action may hold different meanings depending its surrounding context. To address this issue, we propose ActionPiece to explicitly incorporate context when tokenizing action se- quences. In ActionPiece, each action is repre- sented as a ser of item features. Given the action sequence corpora, we construct the vocabulary by merging feature patterns as new tokens, based their co-occurrence frequency both within in- dividual sets and across adjacent sets. Consid- ering the unordered nature of feature sets, we further introduce set permutation regularization, which produces multiple segmentations of ac- tion sequences with the same semantics. Our code is available at: https: wht.t com/ google deeeminddacttionnno.
Sequenze of Feature Sats
923
9A11
943
799
1100
1151
1129
Segment
4T V13
1067
345
264
679
941
1100
291
635
Sequence
18944 21083
754
76
667
20155
1100
7945
1754 6764
Segment
245
1100
245
291
Sequence 2
747
2294
21003
MSTO
76
362
19HNS
24364
276
6788
1734
Figure I. Illustraiion of the tokenization process of ActionPiece. Each action is represented as an unordered feature set. This figure presents two possible tokenized sequences, where features are grouped into different segments. The same action can be tokenized into different tokens depending on surrounding context. detailed case study can be found in Section 4.5.
interacted items) into discrete tokens, GR models learn to autoregressively generate tokens, which are then parsed into recommended items. These tokens share a compact vocabu- lary that does not scale with the item pool size, improving model scalability, memory efficiency, and recommendation performance. The input action sequence is vital in under- standing user intentions (Hidasi et al., 2016; Li et al., 2017; Kang & McAuley, 2018), which organizes user's historical interactions in chronological order. The same action (e.g.. purchasing the same item) may have different meanings in different action sequences. Evidence of taking a certain action can be found in the context, such as whether other items in the sequence share the same brand, color tone, or price range (Zhang al., 2019; Zhou al., 2020; Hou et al., 2022; 2023; Yuan et al., 2023).
1. Introduction
Generative recommendation (GR) (Tay al., 2022; Ra- jput et al., 2023; Zheng et al., 2024; Zhai et al., 2024) is an emerging paradigm for the sequential recommendation task (Hidasi et al., 2016; Kang & McAuley, 2018). By tokenizing the user actions (typically represented by the
Despite the importance of contextual relations among ac- tions, existing methods tokenize each action independently of its context (summarized Table 1). The typical pipeline for tokenizing action sequences involves two steps: (1) To- kenizing each action/item individually into pattern of to- kens; (2) Replacing each action in the input sequence with its corresponding token pattern. In this way, the tokens do not explicitly contain the context. Instead, they solely rely on the autoregressive model's parameters being well-trained to generalize effectively in understanding the context, which challenges the capabilities of GR models. As compari-
"Work done as a student researcher at Google DeepMind. 'University of California, San Diego "oooge DeepMind. Corre- spondence Yupeng Hou and Jianmo Ni <yphou@uesd. edu, j canmon@googla. com>.
Proceedings of the 4dnd International Conference Machine Learning. Vancouver, Canada. PMLR 267, 2025. Copyright 2025 by the author(s).

---

ActionPiece: Contextually Tokenizing Action Sequences for Generative Recommendation
son, tokenization in language modeling also originates from context-independent methods, such as word-level tokeniza- tion (Sutskever et al., 2014; Bahdanau et al., 2015). A decade of progress has led to most tokenization methods for modern large language models (LL.Ms) (OpenAI, 2022;
Table I. Comparison of different action tokenization methods for generative recommendation. "Contextual" denotes whether the same actions can be tokenized into different tokens based on the surrounding context. "Unordered" denotes whether the item fea- tures or semantic IDs are used in an order-agnostic manner.
Anil et al., 2023; Touvron et al., 2023; Zhao et al., 2023)
adopting context-aware approaches, including BPE (Sen- nrich et al., 2016) and Unigram tokenization (Kudo, 2018),
Action Tokenization
Example
Contextual Unordered
Product Quantization
VQ-Rec (Hou et al., 2023)
which tokenize the same word roots along with their adja- cent context into different tokens.
lierarchical Clustering
P5 CID (Iuua et al., 2023)
X
Residual Quantization
TIGER (Rajput et al., 2023)
X
Text Tokenization
I MMIneexer (Tin et al., 2024)
X
X
Raw Features
HSTU (Zhii et al., 2024)
X
X
In this work, we aim to make the first step towards context- aware tokenization for modeling action sequences. In anal- ogy to how characters or bytes serve as the basic units in language modeling, we consider the associated features of an item as initial tokens. The idea is to iteratively find the most commonly co-occurring pairs of tokens among the training action sequences, then merge them into new tokens to represent segments of context. However, it's non-trivial to achieve this. Unlike text, where characters naturally form a sequence, the features associated with an action form an unordered set (Zhang et al., 2019; Zhou et al., 2020). Thus, the proposed tokenization algorithm should be applied on se- quences of loken sets. We need carefully consider which pairs of tokens should be counted, whether within single set or between two adjacent sets, and how much weight should be given to these different types of relationships.
SentenosPiece
SPM-SID (Singh et al., 2024)
X
ActionPicce
Ours
V
icant engineering and optimization challenges (Hidasi et al., 2016; Li et al., 2017: Kang & McAuley, 2018). Generative recommendation (Rajput et al., 2023; Zheng et al., 2024; Zhai et al., 2024; Deldjoo et al., 2024; Hou et al., 2025) ad- dresses these issues by tokenizing each item as tokens from shared vocabulary. By autoregressively generating the next tokens as recommendations, this generative paradigm offers benefits such as memory efficiency (Rajput et al., 2023; Yang et al., 2024; Ding et al., 2024), scalability (Zhai et al., 2024; Liu et al., 2024b), and easier alignment with LLMs (Zheng et al., 2024; Jin al., 2024; Tan et al., 2024; Li et al., 2025). Existing research has developed different action tokenization techniques, such hierarchical cluster- ing (Hua et al., 2023; Si et al., 2024), quantization (Rajput et al., 2023; Wang et al., 2024a; Zhu et al., 2024a), or jointly training with recommendation models (Liu et al., 2025). Other works incorporate additional modalities like collab- orative filtering (Petrov & Macdonald, 2023; Wang et al., 2024c:b; Liu et al., 2024b;a) and natural language (Zheng et al., 2024; Jin et al., 2024; Hou et al., 2024b; Zhang et al., 2025a). However, current methods tokenize each action independently, ignoring the surrounding context. In this work, we propose the first context-aware action tokenization method, where the same actions are tokenized differently in different action sequences.
To this end, we propose ActionPiece, which enables the same actions to be tokenized into different tokens based on their surrounding context. (1) Vocabulary construc- tion begins by initializing the vocabulary include every unique feature as initial tokens. The vocabulary is then con- structed by iteratively learning merge rules. Each merge rule specifies that a pair of tokens can be merged into a new token. In each iteration, we enumerate the training corpus to count the co-occurrence of existing tokens. Considering the structural differences between token pairs, e.g., whether they occur within single set or between two adjacent sets, we assign different weights to different pairs. (2) Segmenta- tion refers to dividing raw features in action sequences into groups that can be replaced by tokens from the vocabulary. To fully exploit the unordered nature of the feature set of each action, we introduce set permutation regularization. By randomly permuting the features within each set, we can produce multiple token sequences of single action sequence that preserve the same semantics. These variations act as natural augmentations for training data and enable inherent ensembling during model inference.
Tokenization for language modeling. Tokenization is the process of transforming raw text into discrete token se- quences (Kudo & Richardson, 2018). Early word-level methods are context-independen and struggle to tokenize vocabulvocabulary words (Sutskever et al., 2014; Bahdanau et al., 2015). Consequently, subword-level tokenization has gradually become the more mainstream choice. The vocab- ularies of these subword-level tokenizers are constructed iteratively, either bottom-up (starting with small vocabu- lary and merging commonly occurring token pairs as new tokens) (Wu et al., 2016; Sennrich et al., 2016). or top-down (starting with a large vocabulary and pruning tokens to min- imize likelihood decrease) (Kudo, 2018; Yehezkel & Pinter, 2023). Once the vocabulary is built, the text can be seg-
2. Related Work
Generative recommendation. Conventional sequential recommendation models often relies on large embedding tables to store representations for all items, leading to signif-
2

---

ActionPiece: Contextually Tokenizing Action Sequences for Generative Recommendation
Algorithm 1 ActionPiece Vocabulary Construction
Action sequence as a sequence of sets. Representing each item as unordered set, the input action sequence be written as S = A2,.... Ar).
input Sequence corpus S" initial tokens Vu, target size Q output Merge rules R, constructed vocabulary V
which is a chronologi- cally ordered sequence of sets. There is no order within each set, but there are orders between the features from different sets. The tokenizer design should account for the ordered and unordered relationships among features.
I: Initialize vocabulary V - Vo Each initial token corresponds
one unique item feature
2: R. 4-
3: while [V] < Q do
4: # #Count: accumulate weighted token co-oceurrences
5: count(;;-)
Count(S", V) # Algorithm 2
Generative recommendation task. In this work, we aim to design tokenizer that maps input action sequence 5' to where / denotes the token sequence C {cr, c Cr). number of tokens in the sequence. Note that / is typically greater than the number of actions t. Next, we train a GR model to autoregressively generate tokens (c+1)...,,gh which can be parsed as next-item predictions it+1.
6: # &Update: merge frequent token pair into new token
7: Select (ce,co) <- arg m..((..))) count(cs, (i, e₁)
8: S' <- Update(S', {(ex, + Guww)) Algorithm
9: R a RURR ((eu, Co) - Cnew } # New merge rule
10: V < --VU {Crew} #f Add new token to the vocabulary
11:
end while
return R, V
3.2. Contextual Action Sequence Tokenizer
mented either using the same method employed during vo- cabulary construction or based on additional objectives (He
The proposed tokenizer is designed to transform action se- quences (represented as sequences of feature sets) into token sequences. In the token corresponds to a set containing varying numbers of features. For example, a token can represent: (1) a subset of features from one item; (2) a single feature; (3) all features of one item; or (4) features from multiple items. We also label these four types of tokens in Figure 1. Below, we first describe how to construct the ActionPiece tokenizer's vo- cabulary given a corpus of action sequences (Section 3.2.1) I). Then, we introduce how to segment action sequences into a new sequence of sets, where each set corresponds to a token from the constructed vocabulary (Section 3.2.2).
et al., 2020; Provilkov et al., 2020; Hofmann et al., 2022: Schmidt et al., 2024). As an analogy, existing action tokeniz- ers are context-independent and function like "word-level" language tokenizers. In this work, we take the first step toward context-awand subaction-lewe level action tokenizer.
-eieecee---eeezed sequences, each
3. Method
In this section, we present ActionPiece, a context-aware method for tokenizing action sequences for generative rec- ommendation. First, we formulate the task in Section 3.1. Then, we introduce the proposed tokenizer, covering vocab- ulary construction and segmentation, in Section 3.2. Finally, we describe the model training and inference process using ActionPiece-tokenizee sequences in Section 3.3.
3.2.1. VOCABULARY CONSTRUCTION ON ACTION SEQUENCE CORPUS
Given a corpus of action sequences S', the goal of vocab- ulary construction to create a vocabulary y of Q tokens. Each token represents a combination of features that fre- quently occur in the corpus. Similar to BPE (Sennrich et al., 2016), we construct the vocabulary using a bottom-up ap- proach. The process starts with initial vocabulary of tokens Vo. The construction proceeds iteratively, adding one new token to the vocabulary at each iteration until the pre- defined target size is reached. Each iteration consists of two consecutive steps: count, where the most frequently occur- ring token pair is identified, and update, where the corpus is modified by merging the selected pair into a new token. An algorithmic workflow is illustrated in Algorithm 1.
3.1. Problem Formulation
Given a user's 's historical actions S = {i1, i2...., ir), orga- nized sequentially by their timestamps, the task is to predict the next item 4411 the user will interact with.
Action as an unordered feature set. In the development of modern recommender systems, each item iy is usually associated with set of features Aj (Zhang al., 2019; Zhou et al., 2020; Cheng et al., 2016). Assuming there are m features per item, the k-th feature of item i, is denoted as f5.k E FR. where F& is the collection of all possible choices for the k-th feature. Compared to representing actions using ordered semantic IDs (e.g.. those produced by RQ-VAE (Rajput al., 2023; Singh al., 2024)), the unordered set setting offers two key advantages: (1) It does not require specific order among features, which aligns better with how items or actions are represented in most recommender systems; (2) It enables the inclusion of more general discrete and numeric features, such as category, brand, and price (Pazzani& & Billsus, 2007; Juan et al., 2016).
Vocabulary initialization. In BPE, each token represents sequence of bytes. Thus, the most fundamental units- the initial tokens-are single bytes, which form the initial vocabulary of BPE. Similarly, each token in ActionPicce represents set of features. Therefore, we initialize Action- Piece with vocabulary in which each token represents set containing one unique item feature. Formally, we denote the
3

---

ActionPiece: Contextually Tokenizing Action Sequences for Generative Recommendation
sequence of token sets
loken
10-0
4
P(O.O)
tokens in the same set: Eqn. (1)
<O,0>|
|
P(O.
tokens from adjacent sets: Eqn. (2)
4 x
flattening
3
POO
tokens in the same set: Equ. (1)
(
Figure 2. Illustration of how weights of co-occurring token paits counted during vocabulary construction. In this example, two adjacent sets in the sequence are considered: one with 4 tokens (represented as O) and another with 3 tokens (represented as N). Token pairs are counted within single set (< O.O and 7, >) and across the adjacent sets (< 7,)>).
initial vocabulary Vo fc= {f]lf E Fi U... U... After initializing the vocabulary, each action sequence (of feature sets) can be represented as sequence of token sets.
Cj might appear in the same set in one sequence but in two adjacent sets in another sequence. By iterating through the corpus, we sum up the weights for each token pair whenever they appear together multiple times.
Count: context-aware token co-occurrence counting. In each iteration of vocabulary construction, the first step is to count the co-occurrence of token pairs in the corpus. These pairs capture important feature combinations, which are coded by creating new tokens. There are two types of token co-occurrence within sequence of sets: (1) two tokens exist within the same set, or (2) two tokens exist in adja- cent sets in the sequence. Notably, the second type allows ActionPiece to explicitly include context information.
Update: corpus updating with action-intermediate nodes. The next step each iteration is to merge the token pair with the highest accumulated co-occurrence weight. Since token merging may change the set size, use double-ended linked list (Zouhar et al., 2023) to maintain each action sequence, where each node represents set of to- kens. Merging tokens within the same set is straightforward, i.e. replacing the two tokens with a new one. However, merging tokens from two adjacent sets is more complex, e.g. determining which set should include the new token.
Weighted co-occurrence counting. In one-dimensional token sequences (e.g., text), all token pairs are typically treated equally. However, in sequences of token sets, token pairs vary based on their types and the sizes of their respective sets. To account for these differences, we propose assigning different weights to token pairs. To determine the weight for each token pair, we relate sequences of token sets to token sequences by randomly permuting the tokens within each set and flattening them into single token sequence. Let P(c, d') represent the expected probability that tokens and e' are adjacent in the flattened sequence. For two tokens from the same set, we have:
Intermediate Node. We introduce the concept of "interme- diate node" to handle tokens that combine features from multiple sets. Initially, all nodes in the maintained linked lists contain features specific to their corresponding actions. These nodes are referred to as "action nodes."
(1) When tokens from two adjacent action nodes are he- ing merged, we insert a new intermediate node between the two action nodes. The new token is stored in the interme- diate node, and the merged tokens are removed from their respective action nodes;
(2) When merging tokens from an action node and an intermediate node, the new token replaces the original token in the intermediate node. The reason is that this new token also combines features from multiple actions. After the merge, the token from the action node is removed.
P(c),02) = P(c), = A
C1,2 E Ais
(1
A,,
(1)
and for two tokens from adjacent sets, we have:
Following the above update rules ensures that there is at most one intermediate node between any two action nodes, and each intermediate node contains no more than one to- ken. When calculating co-occurrence weights involving an intermediate node, it can simply be treated as a set of size 1.
P(C1, c3) = LA, x A4+1l
C1 E C3 E A1t1.
(2)
By considering the probabilities of all adjacent token pairs in the flattened sequence as 1, the weights for token pairs in the original sequence of token sets correspond the probabilities given in Equations (1) and (2). An illustration is shown in Figure
Efficient implementation. Naively counting and updating the corpus requires total time complexity of O(QN Lmm)) where Q is the target vocabulary size, N is the number of action sequences in the training corpus, and L is the average length of these sequences. However, it is unnecessary to count co-occurrences from scratch in each iteration. This
Accumulating co-occurrence weights. The weights de- scribed above are calculated based solely on the co- occurrence type and the set size. They do not take into account the specific tokens being analyzed. Tokens e; and
4

---

ActionPiece: Contextually Tokenizing Action Sequences for Generative Recommendation
Merge tokens in one uction node
Merge tokens in two adjacent action nodes
Merge tokens in action & intermediate nodes
Linked List
Action Node
Intermediate Node
Original Token
Token
New token the original action node
Insert new intermediate node
New token the intermediate node
Figure 3. Illustration of how the linked list, which maintains the action sequence, is updated when merging tokens into token. Three cases are considered: (1) both tokens are in the same action node; (2) the tokens are in two adjacent action nodes; (3) one token is in an action node, while the other is in an intermediate node.
because only small portion of the maintained linked lists is modified compared to the previous iteration.
to bias, where only subset of tokens in the vocabulary is frequently used (as shown empirically in Section 4.4.2).
Data structures. To address this, we propose creating in- verted indices to map token pairs to all the linked lists that contain them. global heap maintained to return the token pair with the highest accumulated co-occurrence. The key challenge lies in updating these data structures. We care- fully compute the changes in accumulated co-occurrences and update the inverted indices. For the heap, we employ lazy-update strategy. We insert the latest weights with tag. When fetching a value from the heap, we check the tag to verify if the value up-to-date. If not, we discard the value and fetch the next one.
Set permutation regularization (SPR). To address this is- sue and account for the unordered nature of sets, we propose set permutation regularization, which generates multiple segmentations for each action sequence. The key idea is to avoid enumerating all possible pairs between tokens in set or adjacent sets. Instead, generate random permutation of each set and treat it as one- one-dimesiional sequence. By concatenating all the permutations, we create a long token sequence. This sequence can then be segmented using tradi- tional BPE segmentation methods (Sennrich al., 2016). In this approach, different permutations can produce distinct segmented token sequences with the same semantics. These sequences serve as natural augmentations for model train- ing (Section 3.3.1) and enable inherent ensembling during model inference (Section 3.3.2).
Time complexity. Let H Lm) represent the maxi- mal heap size. Using the proposed algorithm, we success- fully reduce the original time complexity to Ollog Q log H NLm)), achieving efficient vocabulary construction. In practice, the later iterations take significantly less time than the initial ones. This expected and because tokens with higher accumulated co-occurrence weights typically appear frequently in the early stages. However, the overall construc- tion time benefits from the reduced amortized complexity. Further details about the vocabulary construction algorithm are provided in Appendix C.
3.3. Generative Recommendation Models
3.3.1. TRAINING ON AUGMENTED TOKEN SEQUENCES
For an action sequence and its ground-truth next action in the training corpus, we tokenize them into token sequences Cin and Cout- respectively. Taking Cn as input, we train a Transformer encoder-decoder module (Raffel al., 2020) to autoregressively generate Cout (e.g., next-token prediction objective (Rajput et al., 2023)). During training, tokenize the action sequence using the set permutation regularization described in Section 3.2.2 in each epoch. This approach nat- urally augments the training sequences, which empirically improves model performance, as shown in Section 4.3.
3.2.2. SEGMENTATION BY SET PERMUTATION REGULARIZATION
Segmentation is convert original action sequences into sequence of feature sets. Each set in the segmented sequence corresponds to token in the vocabulary.
Naive segmentation. One segmentation strategy in Action- Piece involves applying the same technique used to con- struet the vocabulary. Specifically, this technique iteratively identifies token pairs with high priorities (represented by the IDs of tokens, where tokens added earlier may have higher priority). However, we observed that this strategy lead
3.3.2. INFERENCE- TIME ENSEMBLING
During model inference, we tokenize each action sequence q times using permutation regularization. By passing these q tokenized sequences through the model, obtain q output ranking lists (e.g., using beam search for inference
5

---

ActionPiece: Contextually Tokenizing Action Sequences for Generative Recommendation
Table Comparison between the widely used text tokenization method, byte-pair encoding (BPE) (Sennrich al., 2016), and the proposed context-aware action sequence tokenization method, ActionPiece.
Aspect
BPE
ActionPiece
Data Type
text sequences a byte sequence
action (unordered feature set) sequences
Token
a feature set
Initial Vocabulary
single bytes
single-fcature sets feature pairs within set between adjacent sets probabilistic weighting (Figure 2)
Merging Unit
adjacent byte pairs raw frequency counting
Co-occurrence Weighting
Segmentation Strategy
greedy fixed-order merging N/A
sel permutation regularization (Algorithm 4) intermediate nodes for cross-action merges
Intermediate Structures
when TIGER (Rajput al., 2023) is the GR backbone). We then combine these ranking lists by averaging the scores of each predicted item. This approach applies data-level ensembling, which has been shown to enhance recommen- dation performance, as discussed in Section 4.4.3.
Table 3. Statistics of the processed datasets. "Avg. t" denotes the average number of actions in an action sequence.
Datasets
#Users
#ltems
#Actions
Avg.
Sports
35,598
18,357
260,739
8.32
Beauty
22,363
12,101
176,139
8.87
3.4. Discussion
CDs
75,258
64,443
1,022,334
14.58
Orders in action sequences. In recommender systems, user actions are typically represented as sets of features, such as the title and price of the associated item. These features typically have inherent order within single action. How- ever, in sequential recommendation tasks, user's historical actions are usually ordered by timestamp to capture tempo- ral behavioral dynamiis. Building on this, we model action sequences as sequences of feature sets: while the features within each action remain unordered, the temporal order- ing of actions preserved. This evolving composition of features over time captures mcaningful sequential patterns.
4. Experiments
4.1. Experimental Setup
Datasets. We use three categories from the Amazon Re- views dataset (McAuley et al., 2015) for our experiments: "Sports and Outdoors" (Sports), "Beauty" (Beauty), and "CDs and Vinyl" (CDs). Each user's historical reviews are considered "actions" and are sorted chronologically as ac- tion sequences, with carlier reviews appearing first. To evaluate the models, we adopt the widely used leave-last- out protocol (Kang & McAuley, 2018; Zhao et al., 2022; Rajput al., 2023), where the last item and second-to-last item in each action sequence used for testing and vali- dation, respectively. The statistics of the processed datasets are shown in Table 3. More details about the datasets can be found in Appendix F.
ActionPiece vs. BPE. While ActionPiece follows similar algorithmic framework as BPF, the key distinction lies in the data formats they are designed to model. BPE operates on one-dimensional byte sequences, whereas ActionPiece is tailored for tokenizing sequences of feature sets. Modeling each action as an unordered set aligns better with the inher- ent structure of action sequences. For clarity, we summarize the key differences in Table 2.
Compared methods. We compare the performance of Ac- tionPiece with the following methods: (1) ID-based sequen- tial recommendation methods, including BERT4Rec (Sun et al., 2019), and SASRec (Kang & McAuley, 2018); (2) feature-enhanced sequential recommendation methods, such as FDSA (Zhang et al., 2019), $ -3-Rec (Zhou et al., 2020), and VQ-Rec (Hou et al., 2023); and (3) generative recommendation methods, including P5-CID (Hua et al., 2023), TIGER (Rajput al., 2023), LMIndexer (Jin et al., 2024), HSTU (Zhai et al., 2024), and SPM-SID (Singh et al., 2024), each representing different action tokeniza- tion method (Table 1). A detailed description of these base- lines is provided in Appendix G.
Efficiency impact of SPR. Despite introducing set permuta- tion regularization, the training efficiency remains compara- ble to existing methods such as TIGER. Feature permutation is performed on the CPU and runs asynchronously alongside TPU/GPU model updates, resulting in no noticeable degradation in training speed. At inference time, SPR intro- duces additional FLOPs due to the ensemble of augmented test cases. However, the overall latency remains comparable to baseline methods, as the augmented versions can be pro- cessed in parallel across multiple computing devices (e.g., TPUs or GPUs). This parallelism offsets the added compu- tation, enabling our method maintain efficient inference despite the use of inference-time ensembling.
Evaluation settings. Following Rajput et al. (2023), we use Recall K and NDCG@ K as metrics to evaluate the meth-
6

---

ActionPiece: Contextually Tokenizing Action Sequences for Generative Recommendation
Table 4. Performance comparison of different methods on the Amazon Reviews dataset (McAuley al., 2015). The best and second-best performance is denoted in bold and underlined fonts. "R@K" and "N@K" K" are short for "Recall K" and "NDCG@K", respectively. "Improv." denotes the percentage improvement of our method compared to the strongest baseline method.
ID-based
Feature + ID
Generative
Datasets Metric
Improv.
BERT4Roc SASRcc
FDSA
S Rec
VQ-Ree P5-CID
TIGER LMIndexer
HSTU
SPM-SID
ActionPicce
R@5
0.0115
0.0233
0.0182
0.0251
0.0181
0.0287
0,0264
0.0222
0.0258
0.0280
0.0316 + 0.0005
+12.86%
Sports
N V@5
0.0075
0.0154
0.0122
0.0161
0.0132
0.0179
0.0181
0.0142
0.0165
0.0180
0.0205
a Lo0ic
+11.71%
R@ 10
0.0191
0.0350
0,0288
0,0385
0.0251
0.0426
0,0400
0,0414
0,0446
0.0500
+12.11%
N@ 10
0.0099
0.0192
0.0156
0.0204
0.0154
0.0224
0.0225
0.0215
0.0234
0.0264
0000
+12.82%
R@5
0.0203
0.0387
0.0267
0,0387
0.0434
0.0468
0,0454
0,0415
0,0469
0.0475
0.0511
a 00001
+7.58%
Beauty
N 5
0.0124
0.0249
0,0163
0,0244
0.0311
0,0315
0,0321
0,0262
0,0314
0.0321
0.0340
+ 0.0011
+5.92%
R@ 10
0.0347
0.0605
0.0407
0.0647
0.0741
0.0701
0.0648
0.0704
0.0714
0.0775
00017
+4.59%
N@ 10
0.0170
0.0318
0.0208
0.0327
0.0372
0.0400
0,0384
0.0389
0.0399
0.0424
0.0011
+6.00%
R@5
0.0326
0.0351
0,0226
0,0213
0.0314
0,0505
0.0492
0,0417
0.0509
0.0544
+
+6.88%
N@S 5
0.0201
0.0177
0.0137
0.0130
0.0209
0.0326
0.0329
0.0275
0.0337
0.0359
+6.53%
CDs
R 10
0.0547
0.0619
0.0378
0.0375
0.0485
0.0785
0.0748
0.0638
0.0778
0.0830
0.0008
+5.73%
N@
0.0271
0.0263
0.0186
0.0182
0.0264
0,0416
0.0411
0.0346
0.0424
0.0451
+ 0.0005
+6.37%
ods, where K {5, 10). Model checkpoints with the best performance on the validation set used for evaluation the test set. We run the experiments with five random seeds and report the average metrics.
Table S. Ablation analysis of ActionPiece. The recommendation performance is measured using NDCG@ @ 10. The best performance is denoted in bold fonts.
Variants
Sports
Beauty
CDs
Implementation details. Please refer to Appendix H for detailed implementation and hyperparameter settings.
TIGER with varying vocabulary sizes
(1.1) TIGER- 192 (4 48)
0,0231
0.0362
N/A
4.2. Overall Performance
(1.2) TIGER - 7768 (3 x 2*)
0.0220
0.0378
0.0331
(1.3) TIGER 1k (4 x 2*)
0.0225
0.0384
0.0411
We compare ActionPiece with sequential recommenda- tion and generative recommendation baselines, which use various action tokenization methods, across three public datasets. The results are shown in Table 4.
(1.4) TIGER-49K (6 x 2
0.0162
0,0317
0.0338
(1.5) TIGER-66k (1 x 2
0.0194
N/A
0.0319
Vocabulary construction
(2.1) w/o tokenization
0.0215
0,0389
0,0346
For the compared methods, observe that those using item features generally outperform item ID-only methods.
(2.2) w/o context-aware
0.0258
0,0416
0.0429
(2.3) w/o weighted counting
0.0257
0.0412
0.0435
This indicates that incorporating features enhances recom- mendation performance. Among the methods leveraging item features ("Feature + ID" and "Generative"), generative recommendation models achieve better performance. These results further confirm that injecting semantics into item sub-item level enables genera-
Set permutation regularization
(3.1) only for inference
0.0192
0.0316
0.0329
(3.2) only for training
0.0244
0.0387
0.0422
(3.3) TIGER + SPR
0.0202
0.0330
0.0351
ActionPiece (40k)
0.0264
0.0424
0.0451
indexing and optimizing tive models to better use semantic information and improve recommendation performance. Among all the baselines, SPM-SID achieves the best results. By incorporating the SentencePiece model (Kudo & Richardson, 2018), SPM- SID replaces popular semantie ID patterns within each item with new tokens, benefiting from larger vocabulary.
not applicable because the number of conflicts among semantic ID prefixes (the first three tokens) in CDs exceeds 48. not applicable because 2 is larger than #items in Beauty.
patterns that enhance recommendation performance.
4.3. Ablation Study
Our proposed ActionPiece consistently outperforms all base- lines across three datasets, achieving a significant improve- ment in NDCG@ 10. It surpasses the best- pest-performing base- line method by 6.00% to 12.82%. Unlike existing methods, ActionPiece is the first context-aware action sequence tok- enizer, i.e., the same action can be tokenized into different tokens depending on its surrounding context. This allows ActionPiece to capture important sequence-level feature
We conduct ablation analyses in Table 5 study how each proposed technique contributes to ActionPiece.
(1) To examine whether the performance gain of Ac- tionPiece stems from the choice of vocabulary size, we conduct an ablation study by varying the vocabulary size of TIGER. We increase the number of semantic ID digits per item (4 + 6) and the number of candidate semantic IDs per digit (28 - 213 or 214), resulting in two TIGER variants
7

---

ActionPiece: Contextually Tokenizing Action Sequences for Generative Recommendation
Sports
Beauty
CDs
1.0
-10
1.00
0.026
0.042
0.044
NDCG@10
0.025
0.9
NDCG@10
0.9
10
0.042
0.95
0.040
0.90
0.024
0.8
0.040
0.023
0.038
0.038
0.85
0.022
0.7
0.036
0.80
0.036
NAAK
30k
N/A5K
20k
20k
Vocabulary Size
Vocabulary Size
Vocabulary Size
NDCG@10
NSL
Figure 4. Analysis of recommendation performance (NDCG@ 10, f) and average tokenized sequence length (NSL,, 4) w.r.t. vocabulary size across three datasets. "N/A" indicates that ActionPiece is not applied, i... action sequences are represented solely by initial tokens.
ken order within RQ-VAE- V-E--base semantic IDs. In contrast, ActionPiece derives different tokens for the same item based its neighboring context, improving token utilization and serving an effective form of data augmentation.
A556.99
Naive SPR (# epochs=1)
01%
95.33%
SPR (# epochs=5)
Taken Utilization Rate (%)
Figure 5. Analysis of token utilization rate (%) during model train- ing w.r.t. segmentation strategy.
4.4. Further Analysis
4.4.1. 1. PERFORMANCE AND EFFICIENCY W.R.T. VOCABULARY SIZE
with vocabularies larger than ActionPicce. We also include two variants with reduced vocabulary sizes by decreasing the number of digits or candidates per digit. Despite the broader range of vocabulary sizes, TIGER variants per- form worse than ActionPiece, and in some cases, even worse than the original TIGER with 1,024 tokens. These results suggest that the performance improvement of ActionPiece is not simply due to scaling the vocabulary size up or down. Instead, they highlight the difficulty of effectively scaling vocabulary size in generative recommendation models, con- sistent with the observations from Zhang et (2024).
Vocabulary size is key hyperparameter for language tok- enizers (Meta AI, 2024; Dagan et al., 2024). In this study, we investigate how adjusting vocabulary size affects the generative recommendation models. We use the normalized sequence length (NSL) (Dagan et al., 2024) to measure the length of tokenized sequences, where smaller NSL indi- cates fewer tokens per tokenized sequence. We experiment with vocabulary sizes in (N/A, 5k, 10k, 20k, 30k, 40k). where "N/A" represents the direct use of item features as tokens. As shown in Figure 4, increasing the vocabulary size improves recommendation performance and reduces the tokenized sequence length. Conversely, reducing the vocabulary size lowers the number of model parameters, im- proving memory efficiency. This analysis demonstrates that adjusting vocabulary size enables trade-off between model performance, sequence length, and memory efficiency.
(2) To evaluate the effectiveness of the proposed vocab- ulary construction techniques, we introduce the following variants: (2.1) w/o tokenization, which skips vocabulary con- struction, using item features directly as tokens; (2.2) w/o context-aware, which only considers co-occurrences and merges tokens within each action during vocabulary con- struction and segmentation; and (2.3) w/o weighted count- ing, which treats all token pairs equally rather than using the weights defined in Equations (1) and (2). The results indicate that removing any of these techniques reduces per- formance, demonstrating the importance of these methods for building a context-aware tokenizer.
4.4.2. TOKEN UTILIZATION RATE W.R.T. SEGMENTATION STRATEGY
As described in Section 3.3.1, applying SPR augments the training corpus by producing multiple token sequences that share the same semantics. In Table 5, we observe that incorporating SPR significantly improves recommendation performance. One possible reason is that SPR increases token utilization rates. To validate this assumption, we segment the action sequences in each training epoch using two strategies: naive segmentation and SPR. As shown in Figure 5, naive segmentation uses only 56.89% of tokens for model training, limiting the model's ability generalize to unseen action sequences. In contrast, SPR achieves
(3) To evaluate the effectiveness of SPR, we revert to naive segmentation, as described in Section 3.2.2, during model training and inference, respectively. The results show that replacing SPR with naive segmentation in either training or inference degrades performance. We also introduce ablation variant that applies SPR to the existing GR model TIGER. The results indicate that SPR alone is insufficient to improve the GR model. When applied to action sequences tokenized by context-inee -nnteeeeindeeendennt methods, SPR does not change token frequencies and merely disrupts the internal to-
8

---

ActionPiece: Contextually Tokenizing Action Sequences for Generative Recommendation
Sports
Beauly
CDs
shirt and feature 679 from the socks, while token 19895 includes feature 1100 from the socks as well features 560 and 943 from the shorts). Notably, the fourth type of token demonstrates that the features of one action can be segmented and grouped with features from adjacent actions. This results in different tokens for the same action depending on the surrounding context, showeasing the context-aware tokenization process of ActionPiece.
0.045
NDCG@10
0.026
0.042
0.044
0.025
0,040
0.043
N/A
3
7
N/A
3
7
N/A
3
Model Inference Ensemble Times (q)
Figure 6. Analysis of performance (NDCG@ 10, 1) w.r.t. the num- ber of ensembled segments q during model inference.
5. Conclusion
token utilization rate of 87.01% after the first training epoch, with further increases as training progresses. These results demonstrate that the proposed SPR segmentation strategy improves the utilization of ActionPiece tokens, enabling better generalization and enhanced performance.
In this paper, we introduce ActionPiece, the first context- aware action sequence tokenizer for generative recommen- dation. By considering the surrounding context, the same action can be tokenized into different tokens in different sequences. We formulate generative recommendation as task sequences of feature sets and merge important feature patterns into tokens. During vocabulary construc- tion, we propose assigning weights to token pairs based on their structures, such as those within a single set or across adjacent sets. To enable efficient vocabulary construction, we use double-ended linked lists to maintain the corpus and introduce intermediate nodes to store tokens that combine features across adjacent sets. Additionally, we propose set permutation regularization, which segments single action sequence into multiple token sequences with the same se- mantics. These segments serve as natural augmentations for training and as ensemble instances for inference.
4.4.3. PERFORMANCE W.R.T. INFERENCE- TIME ENSEMBLES
As described in Section 3.3.2, ActionPiece supports inference-time ensembling by using SPR segmentation. We vary the number of ensembled segments, q. in (N/A, 1, 5, 7), where "N/A" indicates using naive segmentation during model inference. As shown in Figure 6, ensembling more to- kenized sequences improves ActionPiece's 's recommendation performance. However, the performance gains slow down as q increases to 5 and 7. Since a higher g also increases the computational cost of inference, this creates trade-off between performance and computational budget in practice.
In the future, we plan to align user actions with other modal- ities by constructing instructions that combine ActionPiece tokens and other types of tokens. We also aim extend the proposed tokenizer to other tasks that can be framed as set sequence modeling problems, including audio modeling, sequential decision-making and time series forecasting.
4.5. Case Study
To understand how GR models benefit from the unordered feature setting and context-aware action sequence tokeniza- tion, we present an illustrative example in Figure 1.
Each item in the action sequence is represented as feature set, with each item consisting of five features. The features within an item do not require a specific order. The first step of tokenization leverages the unordered nature of the feature set and applies set permutation regularization (Sec- tion 3.2.2). This process arranges each feature set into specific permutation and iteratively groups features based on the constructed vocabulary (Section 3.2.1). This results in different segments that convey the same semantics. Each segment is represented as a sequence of sets, where each set corresponds to a token in the vocabulary.
A Acknowledgements
This work was conducted while Yupeng Hou was stu- dent researcher Google DeepMind. We thank Yichen Zhou for helpful discussions and Nikhil Mehta for valuable suggestions on the draft.
Impact Statement
This paper introduces ActionPiece, a context-aware action sequence tokenizer to enhance generative recommendation. This work aims to advance personalized recommender sys- tems, enabling more accurate understanding of user pref- erences. We argue that this work is not directly correlated to certain society or ethical concerns. The impact of this work is primarily tied to the broader implications of recom- mender systems in various domains, such as e-commerce, entertainment, and social platforms.
By examining the segments and their corresponding token sequences, we identify four types of tokens, as annotated in Figure 1: (1) a subset of features from single item (token 14844 corresponds to features 747 and 923 of the T-shirt); (2) set containing a single feature (feature 76 of the socks); (3) all features of a single item (token 7995 corresponds to all features of the shorts); and (4) features from multiple items (e.g., token 8316 includes feature 923 from the T-
9

---

ActionPiece: Contextually Tokenizing Action Sequences for Generative Recommendation
References
Geng, S., Liu, S., Fu, Z.., Ge, Y., and Zhang, Y. Recommen- dation language processing (rlp): A unified pretrain, personalized prompt & predict paradigm (p5). In RecSys, pp. 299-315, 2022.
Anil, R., Borgeaud, S., Wu, Y., Alayrac, J., Yu, J., Sori- cut, R., Schalkwyk, J., Dai, A. M., Hauth, A., Millican, K., Silver, D., Petrov, S., Johnson, M., Antonoglou, I., Schrittwieser, J., Glaese, A., Chen, J., Pitler, E., Lilli- crap, T. P., Lazaridou, A., Firat, O., Molloy, J., Isard, M., Barham, P. R., Hennigan. T., Lee, B., Viola, F., Reynolds, M., Xu, Y. Doherty, R., Collins, E., Meyer. C., Ruther- ford, E., Moreira, E., Ayoub, K., Goel, M., Tucker, G., Piqueras, E., Krikun, M., Barr, I., Savinov, N., Danihelka, I., Roelofs, B., White, A., Andreassen, A., von Glehn, T., Yagati, L.., Kazemi, M., Gonzalez, L., Khalman, M., Sygnowski, J., and et al. Gemini: A family of highly capable multimodal models. arxiv:2312. 1805, 2023.
He, X., Haffari, G., and Norouzi, M. Dynamic programming encoding for subword segmentation in neural machine translation. In ACL, pp. 3042-3051, 2020.
Hidasi, B., Karatzoglou, A., Baltrunas, I.., and Tikk, D. Session-based recommendations with recurrent neural networks. In ICLR, 2016.
Hofmann, V., Schuetze, H., and Pierrehumbert, J. An em- barrassingly simple method to mitigate undesirable prop- erties of pretrained language model tokenizers. In ACL, 2022.
Bahdanau, D., Cho, K., and Bengio, Y. Neural machine translation by jointly learning to align and translate. In ICLR, 2015.
Hou, Y., Mu, S., Zhao, W. X., Li, Y., Ding, B., and Wen, J.-R. Towards universal sequence representation learning for recommender systems. In KDD, pp. 585-593, 2022.
Bao, K., Zhang, J., Zhang, Y., Wang, W., Feng, F., and He, X. TALLRec: An effective and efficient tuning framework to align large language model with recommendation. In RecSys, 2023.
Hou, Y., He, Z., McAuley, J., and Zhao. W. X. Learning vector-quantized item representation for transferable se- quential recommenders. In WWW, pp. 1162-1171, 2023,
Bian, W., Wu, K., Ren, L., Pi, Q.. Zhang, Y., Xiao, C., Sheng, X.-R., Zhu, Y.-N., Chan, Z., Mou, N., et al. CAN: feature co-action network for click thrkuth rate predic- tion. In WSDM, pp. 57-65, 2022.
Hou, Y., Li, He, Z., Yan, A., Chen, X., and McAuley, J. Bridging language and items for retrieval and recommen- dation. arXiv preprint arXiv:2403.03952 2024a.
Hou, Y., Zhang, J., Lin, Z., Lu, H., Xie, R., McAuley, J., and Zhao, W. X. Large language models are zero-shot rankers for recommender systems. In ECIR, 2024b.
Cheng. H.-T., Koc, L., Harmsen, J., Shaked, T., Chandra, T., Aradhye, H., Anderson, G., Corrado, G., Chai, W., Ispir, M., Anil, R., Haque, Z., Hong. L., Jain, V., Liu, X., and Shah, H. Wide & deep learning for recommender systems. In Proceedings of the 1st Workshop Deep Learning for Recommender Systems, pp. 7-10, 2016.
Hou, Y., Zhang, A., Sheng, L., Yang, Z., Wang, X., Chua. T.- S., and McAuley, J. Generative recommendation models: Progress and directions. In Companion Proceedings of the ACM on Web Conference 2025, pp. 13-16, 2025.
Dagan, G., Synnaeve, G., and Roziere, B. Getting the most out of your tokenizer for pre-training and domain adaptation. In ICML, 2024.
Hua, W., Xu, S., Ge, Y., and Zhang, Y. How index item ids for recommendation foundation models. In SIGIR-AP, pp. 195-204, 2023.
Deldjoo, Y., He, Z., McAuley, J., Korikov, A., Sanner, S., Ramisa, A., Vidal, R., Sathiamoorthy, M., Kasirzadeh, A., and Milano, S. A review of modern recommender systems using generative models (gen-recsys). In KDD, pp. 6448-6458 2024.
Jin, B., Zeng, H., Wang, G., Chen, X., Wei, T., Li, R., Wang. Z., Li, Z., Li, Y., Lu, H., Wang, S., Han, J., and Tang, X. Language models as semantic indexers. In ICMI, 2024.
Juan, Y., Zhuang, Y., Chin, W.-S., and Lin, C.-J. Field-aware factorization machines for ctr prediction. In RecSys, pp. 43-50, 2016.
Ding, Y., Hou, Y., Li, J., and McAuley, J. Inductive gen- erative recommendation via retrieval-based speculation. arXiv preprint arXhv:2410.02939 2024.
Kang. W.-C and McAuley, J. Self-attentive sequential recommendation. In ICDM, pp. 197-206, 2018
Douze, M., Guzhva, A., Deng, C., Johnson, J., Szilvasy, G., Mazaré, P.-E,, Lomeli, M., Hosseini, L., and Jégou, H. The faiss library. arXiv preprint arXiv:2401.0828/ 2024.
Kim, S., Kang, H., Choi, S., Kim, D., Yang. M., and Park, C. Large language models meet collaborative filtering: An efficient all-round Ilm-based recommender system. In KDD, pp. 1 1406, 2024.
Ge, T., He, K., Ke, Q. and Sun, Optimized product quantization for approximate nearest neighbor search. In CVPR, pp. 2946-2929 2953,,953,220 2013.
10

---

ActionPicce: Contextually Tokenizing Action Sequences for Generative Recommendation
Kudo, T. Subword regularization: Improving neural network translation models with multiple subword candidates. In ACL, pp. 66-75, 2018.
Petrov, A. V. and Macdonald, C. Generative sequen- tial recommendation with gptrec. arXiv preprint 2rXiv:2306.111 2023.
Kudo, and Richardson, SentencePiece: A simple and language independent subword tokenizer and detokenizer for neural text processing. In EMNLP. 2018.
Provilkov, I., Emelianenko, D., and Voita, E. Bpe-dropout: Simple and effective subword regularization. ACL, pp. 1882-1892, 2020.
Li, G., Zhang, X., Zhang, Y., Yin, Y. Yin, G., and Lin, W. Semantic convergence: Harmonizing recommender systems via two-stage alignment and behavioral semantic tokenization. In AAAI, 2025.
Raffel, C., Shazeer, N., Roberts, A., Lee, K., Narang, S., Matena, M., Zhou, Y., Li, W., and Liu, J. Exploring the limits of transfer learning with unified text-to-text transformer. Journal of machine learning research, 21 (140):1-67, 2020.
Li, J., Ren, P. Chen, Z., Ren, Z., Lian, T., and Ma, J. Neural attentive session-based recommendation. In CIKM, pp. 1419-1428, 2017.
Rajput, S., Mehta, N., Singh, A., Keshavan, R. H., Vu, T., Heldt, L.,, Hong. L., Tay, Y., Tran, V. Q.. Samost, J., Kula, M., Chi, E. H., and Sathiamoorthy, M. Recommender systems with generative retrieval. In NeurlPS, 2023.
Liao, J., Li, S., Yang, Z., J., Yuan, Y., Wang, X., and He, X. LLaRA: Large language-recommendaa assistant. In SIGIR, 2024.
Schmidt, C. W., Reddy, V., Zhang, H., Alameddine, A..
Uzan, O.,, Pinter, Y., and Tanner, C. Tokenization is more than compression. In EMNLP, 2024.
Liu, E., Zheng, B., Ling, C., Hu, L.,, Li, H., and Zhao, W. X. End-to-ent learnable item tokenization for generative recommendation. In SIGIR, 2025.
Sennrich, R., Haddow, B., and Birch, A. Neural machine translation of rare words with subword units. ACL, pp. 1715-1725, 2016.
Liu, H., Wei, Y., Song, X., Guan, W., Li, Y.FF., and Nie, L. Mmgree: Multimodal generative recommendation with transformer model. arXiv preprint arXiv:2404.16555, 2024a.
Shan, Y., Hoens, T. R., Jiao, J., Wang, H., Yu, D., and Mao, J. Deep crossing: Web-scale modeling without manually crafted combinatorial features. In KDD, pp. 255-262, 2016.
Liu, Z., Hou, Y., and McAuley, J. Multi-behavior generative recommendation. In CIKM, 2024b.
Sheng, L., Zhang, A., Zhang, Y., Chen, Y., Wang, X., and Chua, T.-S. Language representations can be what recom- menders need: Findings and potentials. In ICLR, 2025.
McAuley, J., Targett, C., Shi, Q. and Van Den Hengel, A. Image-based recommendations on styles and substitutes. In SIGIR, pp. 43 52, 2015.
Si, Z., Sun, Z., Chen, J., Chen, G., Zang, X., Zheng, K., Song, Y., Zhang, X., Xu, J., and Gai, K. Generative retrieval with semantic tree-structured item identifiers via contrastive learning. In SIGIR-AP, 2024.
Meta AL. Introducing Meta Llama 3: The most capable openly available LLM to date, 2024. URL https:// meta. com melloo/mmtaalammee
Ji, Abrego, G. H., Constant, N., Ma, J., Hall, K., Cer, D., and Yang, Y. Sentence-t5: Scalable sentence encoders from pre-trained text-to-text models. Findings of ACL, pp. 1874, 2022.
Singh, A., Vu, T., Mehta, N., Keshavan, R., Sathiamoorthy, M., Zheng, Y., Hong, L., Heldt, I.., Wei, I.., Tandon, D., Chi, E. H., and Yi, X. Better generalization with semantic ids: case study in ranking for recommendations. In RecSys, 2024.
OpenAl. Introducing ChatGPT, 2022. URL https:// openai. com wndinnne//iiiii hwwp//chw/pppt......///m/
Sun, F., Liu, J., Wu, J., Pei, C., Lin, X., Ou, W., and Jiang, P. Bert4rec: Sequential recommendation with bidirectional encoder representations from transformer. In CIKM, pp. 1441-1450, 2019.
Paszke, A., Gross, S., Massa, F., Lerer, A., Bradbury, J., Chanan, G., Killeen, T., Lin, 7., Gimelshein, N., Antiga, L., et al. Pytorch: An imperative style, high-performance deep learning library. NewrlPS, 32, 2019.
Sutskever, I., Vinyals, O., and Le, Q. V. Sequence to se- quence learning with neural networks. In NIPS. 2014.
Pazzani, M. J. and Billsus, D. Content-basse recommenda- tion systems. In The adaptive web: methods and strate- gies of web personalization, pp. 325-341. Springer, 2007.
Tan, J., Xu, S., Hua, W., Ge, Y., Li, Z., and Zhang, Y. Idgenrec: Llm-recsys alignment with textual id learning. In SIGIR, 2024.

---

ActionPiece: Contextually Tokenizing Action Sequences for Generative Recommendation
Tay, Y., Tran, V., Dehghani, M., Ni, J., Bahri, D., Mehta, H., Qin, Z.,, Hui, K., Zhao, Z.,, Gupta, J. P., Schuster, T., Cohen, W. W., and Metzler, D. Transformer memory differentiable search index. In NeurlPS, 2022.
Yehezkel, S. and Pinter, Y. Incorporating context into sub- word vocabularies. In EACI,, pp- 223-635, 2023.
Yuan, Z. Yuan, F., Song, Y., Li, Y., Fu, J., Yang, F., Pan, Y., and Ni, Y. Where to go next for recommender systems? id-vs. modality-based recommender models revisited. In SIGIR, pp. 2639-2649, 2023.
Touvron, H., Lavril, T., Izacard, G., Martinet, X., Lachaux, M., Lacroix, T., Rozière, B., Goyal, N., Hambro, E., Azhar, F., Rodriguez, A., Joulin, A., Grave, E., and Lam- ple, G. Llama: Open and efficient foundation language models. arXiv:2302. 0e222232.139977 13971, 2023.
Zeghidour, N., Luebs, A., Omran, A., Skoglund, J., and Tagliasacchi, M. Soundstream: An end-to-end neural audio codec. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 30:495-507, 2021.
Wang, R., Fu, B., Fu, G., and Wang, M. Deep & cross network for ad click predictions. In Proceedings of the ADKDD'IZ 17, pp. 2017.
Zhai, J., Liao, L., Liu, X., Wang, Y., Li, R., Cao, X., Gao, L.,, Gong, Z., Gu, F,, He, M., Lu, Y., and Shi, Y. Actions speak louder than words: Trillion-paree partomn- sequential transducers for generative recommendations. In ICML, 2024.
Wang, R., Shivanna, R., Cheng, D., Jain, S., Lin, D., Hong, L., and Chi, E. Den v2: Improved deep & cross net- work and practical lessons for web-scale learning to rank systems. In WWW, pp. 1785-1797, 2021.
Zhang. J.. Xie, R., Hou, Y., Zhao, W. X., Lin, L.,, and Wen, J.-R. Recommendation as instruction following: A large language model empowered recommendation approach. ACM Trans. Inf. Syst., 2025a.
Wang, W., Bao, H., Lin, X., Zhang. J., Li, Y., Feng, F., Ng. S.-K., and Chua, T.-S. Learnable tokenizer for Ilm-based generative recommendation. In CIKM, 2024a.
Wang, Y., Ren, Z. Sun, W., Yang. J., Liang, Z., Chen, X., Xie, R., Yan, S., Zhang, X., Ren, P., Chen, Z., and Xin, X. Content-based collaborative generation for recommender systems. In CIKM, 2024b.
Zhang, T., Zhao, P., Liu, Y., Sheng, V. S., Xu, J., Wang, D., Liu, G., and Zhou, X. Feature-level deeper self-attention network for sequential recommendation. In IJCAI, pp. 4320-4326, 2019.
Wang, Y., Xun, J., Hong, M., Zhu, J., Jin, T., Lin, W., Li, H., Li, L., Xia, Y., Zhao, Z., and Dong, Z. Eager: Two- stream generative recommender with sehavior-semanne collaboration. In KDD, pp. 3245-3254, 2024c.
Zhang. T., Pan, J., Wang, J., Zha, Y., Dai, T., Chen, B., Luo, R., Deng, X., Wang, Y., Yue, M., et al. Towards scal- able semantic representation for recommendation. arXiv preprint arXiv:2410.09560. 2024.
Wolf, T., Debut, L., Sanh, V., Chaumond, J., Delangue, C., Moi, A., Cistac, P., Rault, T., Louf, R., Funtowicz, M., Davison, J., Shleifer, S., von Platen, P., Ma, C., Jernite, Y., Plu, J., Xu, C., Le Scao, T., Gugger, S., Drame, M., Lhoest, Q. and Rush, A. Transformers: State-of-the-art natural language processing. In EMNLP, 2020.
Zhang. Y., Feng, F., Zhang, J., Bao, K., Wang, Q., and He, X. CoLLM: Integrating collaborative embeddings into large language models for recommendation. IEEE Transactions Knowledge and Data Engineering, 37 (5), 2025b.
Zhao, W. X., Mu, S., Hou, Y., Lin, Z.., Chen, Y., Pan, X., Li, K., Lu, Y., Wang, H., Tian, C., Min, Y., Feng, Z., Fan, X., Chen, X., Wang, P., Ji, W., Li, Y., Wang. X., and Wen, J.-R. Reebole: Towards unified, comprehensive and efficient framework for recommendation algorithms. In CIKM, 2021.
Wu, Y. Schuster, M., Chen, Z., Le, Q. V., Norouzi, M., Macherey, W., Krikun, M., Cao, Y., Gao, Q., Macherey, K., Klingner, J., Shah, A., Johnson, M., Liu, X., Lukasz Kaiser, Gouws, S., Kato, Y., Kudo, T., Kazawa, H., Stevens, K., Kurian, G., Patil, N., Wang, W., Young, C. Smith, J., Riesa, J., Rudnick, A., Vinyals, O., Corrado, G., Hughes, M., and Dean, J. Google's 's neural machine translation system: Bridging the gap between human and machine translation. arXiv preprint arXiv: (00.600046600 144, 2016.
Zhao, W. X., Lin, Z., Feng, Z., Wang, P., and Wen, J.-R. A revisiting study of appropriate offline evaluation for top-n recommendation algorithms. ACM Transactions on Information Systems, 41(2):1-41) 2022.
Zhao, W. X., Zhou, K., Li, J., Tang, T., Wang, X., Hou, Y.. Min, Y., Zhang, B., Zhang, J., Dong, Z., Du, Y., Yang, C., Chen, Y., Chen, Z., Jiang, J., Ren, R., Li, Y., Tang, X., Liu, Z., Liu, P., Nie, J., and Wen, J. A survey of large language models. arXiv:2303. /8223, 2023.
Yang, L., Paischer, F., Hassani, K., Li, J., Shao, S., Li, Z. G., He, Y., Feng, X., Noorshams, N., Park, S., Long, B., Nowak, R. D., Gao, X., and Eghbalzadeh, H. Unifying generative and dense retrieval for sequential recommen- dation. arXiv preprint ar arXiv:2411.18814 2024.
12

---

ActionPicce: Contextually Tokenizing Action Sequences for Generative Recommendation
Zheng, B., Hou, Y., Lu, H., Chen, Y., Zhao, W. X., Chen, M., and Wen, J.-R. Adapting large language models by integrating collaborative semantics for recommendation. 2024.
Zhu, J., Jin, M., Liu, Q. Qiu, Z., Dong, Z., and Li, X. Cost: Contrastive quantization based semantic tokenization for generative recommendation. In RecSys, 2024a.
In ICDE, pp.
Zhu, Y., Wu, L., Guo, Q. Hong, L.,, and Li, Collabora- tive large language model for recommender systems. In WWW, pp. 3162-3172, 2024b.
Zheng. B., Zhang. J., Lu, H., Chen, Y., Chen, M., Zhao, W. X., and Wen, J.-R. Enhancing graph contrastive learn- ing with reliable and informative augmentation for rec- ommendation. KDD, 2025.
Zouhar, V., Meister, C., Gastaldi, J., Du, L., Vieira, T., Sachan, M., and Cotterell, R. formal perspective on byte-pair encoding. In Findings of ACL, pp. 598-614, 2023.
Zhou, K., Wang, H., Zhao, W. X., Zhu, Y., Wang, S., Zhang, F, Wang, Z., and Wen, J.-R. S3-rec: Self-supervised learning for sequential recommendation with mutual in- formation maximization. CIKM, pp. 1893-1902, 2020.
13

---

ActionPiece:
Contextually Tokenizing Action Sequences for Generative Recommendation
Table 6. Notations and explanations.
Notation
Explaination
i, ii. i
Item, item identifier, item ID The number of actions in the imput action sequence; the timestamp when the model makes prediction The ground-trufe truth next item
fr+1
The predicted next item
8 = (i, ......, de)
The action sequence where each action is represented with the interacted item ID A set of item features tokens
A. AI. A,
[Ayl
The number of features associated with each item The k-th feature item iz
Fr
The collection all possible choices for the k-th feature
S' = (Ai,Az Ac)
The action sequence where each action is represented with set of item features Input & generated tokens
C 1
The number of tokens in the token sequence
C= fci, 02 02:-.,,(1 c
The token sequence tokenized from the input action sequence S
(a-1.....cy }
The tokens generated by GR model
The vocabulary of ActionPiece tokenizer
R
The merge rules of ActionPiece tokenizer
[leu, Cv)
One merge rule indicating two adjacent tokens c, and can be replaced by token Cnew The size of ActionPiece vocabulary
Q [V]
P(c,
The probability that tokens and é' are adjacent when flattening sequence sets a token sequence The number of action sequences in training corpus
N
L
The average length of action sequences in the training corpus
H
Maximal heap size, Lm) The number of segmentations produced using permutation regularization during inference
9
Appendices
A. Notations
We summarize the notations used in this paper in Table 6.
B. Algorithmic Details
In this section, we provide detailed algorithms for vocabulary construction and segmentation.
B.1. Vocabulary Construction Algorithm
The overall procedure for vocabulary construction illustrated Algorithm 1. As described in Section 3.2.1, this process involves iterative Count (Algorithm 2) and Update (Algorithm 3) operations.
B.2. Segmentation with Set Permutation Regularization Algorithm
The detailed algorithm for segmenting action sequences into token sequences using set permutation regularization (SPR) shown in Algorithm 4. In practice, we often run Algorithm 4 multiple times to augment the training corpus or ensemble recommendation outputs, described in Sections 3.3.1 and 3.3.2.
C. Efficient Vocabulary Construction Implementation
To efficiently construct the ActionPiece vocabulary, we propose using data structures such as heaps with a lazy update trick, linked lists, and inverted indices to speed up each iteration of the construction process. The key idea is to avoid recalculating token co-occurrences in every iteration and instead update the data structures. The pseudocode is shown Figure 7.
14

---

ActionPiece: Contextually Tokenizing Action Sequences for Generative Recommendation
Algorithm 2 ActionPiece Vocabulary Construction Count (Figure 2)
input Action sequence corpus S', current vocabulary y
output Accumulated weighted token co-occurrences co.nt(..-)
for
V <- | do
2: count(ci, cj)
3: end for
4: for all sequence S' S' do
5: t length(S") Number of action nodes in sequence
6: for k + to do
7: As -- [k] # Current action node
8: # Process all unordered token pairs within Ag.
9: for all cs Cj E i i i do
10:
count (i (2) count Ci (q) + Ax # Weight of tokens within single set (Equation (1))
Ax
11:
count(cj, ci) count cj c.) + 2/ Ax Symmetric update
12: end for
13:
# Process all ordered token pairs between Ag and Ag+1
14:
k <t- then
15:
A&+1 f Sk S +1
for all C E Ak. Cj Ak+1 do count(e; 0z) count(ci, ej) 1/([AA] (A++I)) Weight of tokens from two adjacent (Equation (2))
17:
18: end for
19: end if
20:
end for
21:
end for
return count(:.-)
C.1. Data Structures
The data structures used in the proposed algorithm are carefully designed to optimize the efficiency of vocabulary construction. Here a detailed discussion of their roles and implementations:
Linked list: Each action sequence in the training corpus is stored a linked list. This allows efficient local updates during token merging. When a token pair (ca, Cv) is replaced by new token Crews only the affected nodes and their neighbors in the linked list need to be modified (as shown in Algorithm 3 and Figure 3).
Heap with lazy update trick: A max- max-heap prioritizes token pairs by their co-occurrences. Instead of recalculating the heap entirely in each iteration, a "lazy update" strategy is employed: outdated entries (with mismatched co- co-occurrence counts) are retained but skipped during extraction. In the pseudocode, the loop checks if the top element is outdated via is out dat.d. Invalid entries are discarded, and only valid ones are processed. Updated co-occurrences are pushed as new entries (with negative counts for max max-heap emulation).
Inverted indices: The pair2head dictionary maps token pairs to the sequences containing them. When a pair (Cuz C.) is merged, the algorithm directly retrieves affected sequence IDs via pair2hear r2head (c_u, c_v) J, avoiding full corpus scan. After merging, the inverted indices are incrementally updated: new token pairs (e.g., (Cpren Crew) and (Cnews Creat)) ) added pai r2head, while obsolete pairs are removed. This enables targeted updates and ensures subsequent iterations efficiently access relevant sequences.
These structures collectively reduce time complexity by focusing computation on dynamically changing parts of the corpus and avoiding redundant global operations. The linked list enables localized edits, the heap minimizes priority recalculation, and the inverted indices eliminate brute-force searches, making the algorithm scalable to large corpora.
C.2. Time Complexity
The time complexity of the efficient vocabulary construction algorithm can be analyzed through two main components: initialization and iterative merging.
15

---

ActionPicce: Contextually Tokenizing Action Sequences for Generative Recommendation
Algorithm 3 ActionPiece Vocabulary Construction Update (Figure 3)
input Action sequence corpus S' before updating, current merge rule {(Cu: Cv) + Cnew output Updated action sequence corpus S*
for sequence 5' S' do
2: length(S')
3: for k < 0 to do
4: A& + [[A]
5: # Merge tokens in one action node
6:
cu E AA and Co E A then
7:
Replace Cu and Cu in Aş with Cnew end if
8:
9:
# Merge tokens from two adjacent nodes
if h: < 1 1-1 then
11:
A4+1 S'
12:
if Cu E AA and Co Ax+1 then if AR+1 are both action nodes then Create intermediate node M between A and Ak+1
13:
14:
15:
M < {Cnww] Linked list: As + M + As+1
A& c Ax Co
17:
Ac+1 c- AR+1 \ Co
18:
else if A₁ is intermediate node then A& + {Crew }
19:
20:
A++1 & -A+1 /ce
21:
else if Akt1 intermediate node then
22:
A + A4 Ca
A++1 +- (Crew)
end if
25:
end if
26: end if
27: end for
28:
end for
return
Initialization phase involves building the initial max-heap to track co-occurrence frequencies. Given N input sequences (each with an average length of L), we count co-occurrences for all O(m²) token pairs within each set of size m. This requires (NN Lm²) time.
Iterative merging phase dynamically processes the involved sequences. The total number of such sequences across all iterations is approximately
N Po
N
N +
O
+0
+ +.................. O
~ O(log QN).
[oo +1
For each sequence, updating the linked list requires O(Tm) time, counting co-occurrences takes ((mm²) time, and inserting co-occurrences into the max-heap requires at most O(Lm² log H) time. Here, // represents the heap size, which at most LmL). Thus, the overall time complexity for iterative merging is
Ollog (Lm + Lm + Lmn log H)) Ollg Q log H Lmm).
Therefore, the overall time complexity of our proposed vocabulary construction algorithm Oloo Qlog H NLm²), where the iterative merging phase dominates. This complexity is significantly better than the naive vocabulary construction complexity of (IQNTm")
16

---

ActionPiece: Contextually Tokenizing Action Sequences for Generative Recommendation
Algorithm 4 Segmentation via Set Permutation Regularization (SPR) (Section 3.2.2)
input Action sequence S, merge rules output Segmented token sequences C
1: C [-] # Initialize permuted initial token sequence
2: for all token set A, E S do
3: Generate random permutation of A; as (2,, 9.4.1]
4: Extend C with [c1, C, .144) # Concatenate permutations
5: end for
6:
7: Apply BPE (Sennrich al., 2016) segmentation on permuted sequence
8: repeat
9:
R' < 0 # Candidate merge rules
10:
for 13++000 to |Cl do
11:
if' [[((,, C++1) + ) E R then
12:
R'+RR ((c, + }'}
13:
end if
14:
end for
Select {(C,, Ck+1) + +c R' with the smallest index among all merge rules R.
16:
C [cI...., Ch- C, c.. Replace (Ck, Ck41) with new token c'
17:
until R' is 0
return C
D. A Aditional Related Work
Aligning LLMs with user actions. A key motivation for developing action tokenization methods to provide an efficient and effective way of aligning pretrained generative models (e.g., LLMs (OpenAI, 2022; Anil et al.. 2023; Touvron et al., 2023; Zhao et al., 2023)) with user action data (Geng et al., 2022; Zheng et al., 2024; Hou al., 2025). typical pipeline involves tokenizing action sequences into action tokens and then performing instruction tuning inputs that combine both language and action tokens. The choice of tokenization strategy plays critical role. We identify three main paradigms:
One token per item: Each action is represented by a single token, resulting in a dense vector that is typically derived from a pretrained semantic encoder or a learnable embedding table (Hou al., 2022; Liao et al., 2024; Zhu et al., 2024b; Zhang et al., 2025b; Kim al., 2024). While this approach efficient in terms of sequence length, it suffers from memory and scalability issues, particularly since the number of unique items often exceeds the typical vocabulary size of LLMs. Aligning LLMs with such large vocabularies introduces both engineering and optimization challenges.
Text-based tokenization: Each action is expressed as textual string, which naturally aligns with the LLMs' native modality (Geng et al., 2022: Zhang et al., 2025a; Bao et al., 2023). However, this leads to substantially longer token sequences, resulting in inefficiencies during tokenization and increased inference latency.
Discrete tokens: Actions are tokenized into a small number of discrete tokens drawn from a compact, shared vocab- ulary (Zheng et al., 2024; Tan et al., 2024: Jin et al., 2024). This approach balances sequence length and memory efficiency, making practical choice for building LLM-based recommender systems.
E. A Additional Discussions
E.1. Benefits of Set Permutation Regularization
SPR benefits the model from multiple perspectives:
Token utilization perspective. SPR effectively prevents the features of a single action from being consistently merged into the most compressed (high-level) tokens. Instead, it allows the action to be tokenized into both high-level and low-level tokens, depending on the permutation and token merge rules. This increases the number of tokens actively involved during both training and inference. As shown in Figure and discussed in Section 4.4.2, SPR significantly
17

---

ActionPiece: Contextually Tokenizing Action Sequences for Generative Recommendation
def vocab_ conssbuttottttiionn..oo iteration (max heap, vocab, rules, pair2head): """Performs one iteration of efficient vocabulary construction.
Args:
max_heap (PriorityQuoue): Max-heap storing (co_occurrence, (c_u, c_v)) pairs. vocab (List[Tuple]] [Tuple]): Current vocabulary with merge rules.
rules (Dict): Merge rule { (c_u, c_v): c_new) mapping.
pair2head (Dict): Inverted indices that store mappings from the token pair to all sequences that contain this token pair.
10
# Get most trequent valid pair [c_u, c_v) from nax-heap
# afficient version of "Count" in Algorithm
12
Avoid recalculating co-occurrences for each iteration, by maintaining them in max-heap with the lazy update trick
15
while not max max_hesa empty
14
co occurrence, (c_u, c_v)
max max__aap.eppeeee hww..
if not is is_outdated (c_u, c_v), :o_occurrence): Outdated values lazily removed. break
16
17
F Create token and update vocabulary c_new len (vocab)
20
vocab. ((c_,, c_v))
21
rules I (c_u, c_v)] c_new
22
# Update sequences containing (c_u, c.v) seq ids = pair2head u ]. () IDs of affected sequences delta_counts defaultdict (int)
24
25
26
for sid in seq_ids:
# Merge all (e_u, c_v) pairs in sequence
29
(seqs [sid], e_u, c_v, c_new) # Replace pairs new_seq new_seq
30
[sid]
31
# Calculate pair co-oceurrence changes
33
new_freqs count_pairs (new_seq) Get token co-occurrences of the updated sequence
34
delta diff frew_freqas old_fregs[sid]] Compute co-ocaurrence fffrennse
update index (pair2tead, delta, sid) Update inverted index old counts sid] new fregs
36
37
38
V Accumulate global co-occurrence changes for ent in delta.items () delta_counts
ent
41
42
# Lazy update max-heap with new co-occurrences for (c_u, c_v), delta in wwt.occuuntieemt.. ():
if abs (delta) eps: continue # eps: minimum update threshold
45
filppair_fregsl/ (c_u, e_v)l delta Global co-occurrences max mox_heap.putt.
56
pair_ (c_u, l_v),, (c_u, c_v))
Figure Pseudocode for single iteration of the efficient vocabulary construction algorithm, illustrating how max- max-hcap with lazy updates is used to track and merge frequent token pairs.
improves token utilization from 56.89% to 95.33% by the 5th epoch indicating that greater proportion of tokens are trained after applying SPR.
Data augmentation perspective. From the perspective of data augmentation, SPR enriches the token sequences available for model training. Without SPR, each action sequence can only be tokenized into a single, fixed token sequence. In contrast, SPR allows each action sequence to be tokenized in multiple ways (as shown in Figure 1). While these augmented sequences preserve the same semantic information, they expose the model to richer token patterns. Training on these diverse token sequences helps the model generalize better, as evidenced by the performance of variant (3.1)
18

---

ActionPiece:
Contextually Tokenizing Action Sequences for Generative Recommendation
in Table 5.
Ensemble perspective. SPR also enables inference- time augmentation. A given imput action sequence can be augmented into multiple token sequences during inference. Each sequence may yield different ranking of the next possible items. By ensembling these recommendation results, overall performance can be enhanced, as demonstrated by variant (3.2)
in Table 5 and further illustrated in Figure 6.
E.2. Connections Between ActionPiece and Feature Crossing
core component of ranking models automatically capturing feature-crossing patterns that are helpful for recommendation performance (Shan et al., 2016; Wang et al., 2017; 2021; Bian et al., 2022), which is conceptually related to ActionPiece. The key difference lies in the level which interactions are modeled. Prior works typically perform automatic feature crossing the model level, learning interactions implicitly through the network architecture. In contrast, ActionPiece merges features at the data level.
Although we do not directly compare against these specific feature-crossing models, we include several baselines that follow a similar design philosophy. For example, HSTU in Table and variant (2.1) in Table 5 use the same underlying item features as ActionPiece but input them in a flattened form, without merging. In these setups, feature interactions are expected to learned by the autoregressive model via self-attention and feed-forward layers, i.e., the model level.
Our results demonstrate that ActionPiece, which performs data-level feature merging, consistently outperforms these methods in both recommendation quality (Tables 4 and 5) and efficiency (Figure 4). This is particularly evident in normalized sequence length (NSL): both HSTU and variant (2.1) yield NSL values of I, reflecting longer sequences compared to the more compact sequences tokenized by ActionPiece.
F. Datasets
Categories. Among all the datasets, "Sports" and "Beauty" are two widely used benehmarks for evaluating generative recommendation models (Rajput et al., 2023; Jin al., 2024; Hua al., 2023). We conduct experiments these benchmarks ensure fair comparisons with existing results. Additionally, we introduce "CDs", which contains about 4x more interactions than "Sports", making it larger dataset for evaluating the scalability of GR models. For "CDs", since there are no publicly available results from generative recommendation methods to date, we closely followed the experimental settings used in public benchmarks like "Sports" and "Beauty" to ensure fair comparisons.
Sequence truncation length. Following Rajput et al. (2023), we filter out users with fewer than 5 reviews and truncate action sequences maximum length of 20 for "Generative" methods, including ActionPiece. For "ID-based" and "Feature + ID" baselines, set the maximum length to 50, suggested in their original papers.
Item text features. Following Rajput et al. (2023); Zheng et al. (2024); Hou et al. (2024a); Sheng et al. (2025), the first step for feature engineering is to combine multiple raw text features into single sentence for each item. Then, we use a pretrained sentence embedding model to encode this sentence into a vector representation. In all our implementations, we concatenate title, price, feature, categories, and description, and use sentence-t5- ---base (Ni et al., 2022) as the sentence embedding model.
The encoded sentence embeddings of 768 dimension are directly used as textual item representations for UniSRec.
We quantize the sentence embeddings using residual quantization (RQ) (Rajput et al., 2023; Zeghidour et al., 2021; Zheng et al., 2025) into three codes, each with 256 candidates. To prevent confficts, we add an extra identification code. These four codes together serve as the RQ-based semantic IDs for TIGER and SPM-SID.
For other baselines that require item features, such as FDSA, S Ree, VQ-Rec, HSTU, and our method, follow Hou et al. (2023) and quantize the sentence embeddings using optimized product quantization (OPQ) (Ge al., 2013). Except for VQ-Rec, where the sentence embeddings are quantized into 32 codes as suggested in the original paper, we quantize the sentence embeddings into 4 codes for all other methods to ensure fair comparison. The codebook size is 256 for each digit of code. For generative methods HSTU and ActionPiece, we also include an additional identification code to prevent conflicts. Note that, unlike RQ-based semantic IDs, features produced by product/vector quantization do not require specific order.
19

---

ActionPiece: Contextually Tokenizing Action Sequences for Generative Recommendation
G. Baselines
We compare ActionPiece with the following representative baselines:
G.1. ID-Based Sequential Recommendation Methods
SASRec (Kang McAuley, 2018) represents each item using its unique item ID. encodes item sequences with a self-attentive Transformer decoder. The model is trained by optimizing a binary cross-entropy objective.
BERT4Rec (Sun et al., 2019) also represents each item using its unique item ID. Unlike SASRec, it encodes sequences of item IDs with bidirectional Transformer encoder. The model trained using a masked prediction objective.
G.2. Feature-Enhanced Sequential Recommendation Methods
FDSA (Zhang et al., 2019) integrates item feature embeddings with vanilla attention layers to obtain feature representa- tions. It then processes item ID sequences and feature sequences separately through self-attention blocks.
Re (Zhou et al., 2020) first employs self-supers supervvie pre- pre-training capture the correlations between item features and item IDs. Then the checkpoints are loaded and fine-tuned for next-item prediction, using only item IDs.
VQ-Rec (Hou et al., 2023) encodes text features into dense vectors using pre-trained language models. It then applies product quantization to convert these dense vectors into semantic IDs. The semantic ID embeddings are pooled together to represent each item. Since the experiments training strategy outlined in the original paper. Instead, we reuse the model architecture and train it from scratch using an in-batch contrastive loss with a batch size of 256.
not performed in transfer learning setting, omit the two-stage stage
G.3. Generative Recommendation Methods
Each generative recommendation baseline corresponds to an action tokenization method described in Table
P5-CID (Hua et al., 2023) is an extension of P5 (Geng et al., 2022), which formulates recommendation tasks in a text-to-text format. Building on P5, the authors explored several tokenization methods to index items for better recommendations. In this study, we use P5-CID as a representative hierarchical clustering- -based action tokenization method. organizes the eigenvectors of the Laplacian matrix of user-item interactions into a hierarchy and assigns cluster IDs each level as item indices. When implementing this baseline method, we adopt the same model backbone as ActionPiece (encoder-decoder Transformers trained from scratch) and the indices produced by P5-CID.
TIGER (Rajput et al., 2023) encodes text features similarly to VQ-Ree but quantizes them into semantic IDs using RQ-VAE The model then trained to autoregressively predict the next semantic ID and employs beam search for inference. We use beam size of 50 in beam search generate the top-K recommendations.
LMIndexer (Jin et al., 2024) takes text as input and predicts semantic IDs. The text description of each item first tokenized using a text tokenizer. The resulting text tokens are then concatenated to form input action sequences. The model trained with self-supervised objectives to learn the semantic IDs of target items. The reported results in Table are taken from the original paper. We do not report the results of LMIndexer on the large dataset "CDs" because it does not converge under similar computing budget the other methods.
HSTU (Zhai et al., 2024) discretizes raw item features into tokens, treating them as input tokens for generative recommendation. The authors also propose lightweight Transformer layer that improves both performance and efficiency. For action tokenization, use the same item features our method and arrange them in specific order form the tokenized tokens of each item.
SPM-SID (Singh et al., 2024) first tokenizes each item into semantic IDs. It then uses the SentencePiece model (SPM) (Kudo & Richardson, 2018) to merge important semantic ID patterns within each item into new tokens in the vocabulary. While the original paper introduces this method for ranking models, we adapt for the generative recommendation task. Specifically, we concatenate the SPM tokens as inputs, feed them into the T5 model, and autoregressively generate SPM tokens as recommendations.
20

---

ActionPiece: Contextually Tokenizing Action Sequences for Generative Recommendation
Table 7. Hyperparameter settings of ActionPicce for each dataset.
Hyperparameter
Sports
Beauty
CDs
learning-rat
0.005
0.001
0.001
warmup-steps
10,000
10,000
10,000
dropout. rate
0.1
0.1
0.1
wecah
0.15
0.15
0.07
vocabulary size
40,000
40,000
40,000
Linference.eemeent
5
5
beam_size
50
50
50
num layers d_model
4
128
128
256
d_ff'
1,024
1,024
2,048
mum_heads d kv optimizer
6
6
64
64
64
adamw
adamw
adamw
Ir scheduler
cosine
cosine
cosine
batchhsizzee
256
256
256
max_epochs
200
200
200
20
20
20
H. Implementation Details
Baselines. The results of BERT4Rec, SASRec, FDSA, -Rec TIGER, and LMIndexer on the "Sports" and "Beauty" benchmarks are taken directly from existing papers (Zhou et al., 2020; Rajput et al., 2023; Jin et al., 2024). For other results, we carefully implement the baselines and tune hyperparameters according to the suggestions in their original papers. We implement BERT4Ree, SASRec, FDSA, and Rec using the open-source recommendation library RecBole (Zhao al., 2021). For other methods, we implement them ourselves with HuggingFace Transformers (Wolf et al., 2020) and PyTorch (Paszke et al., 2019). We use FAISS (Douze et al., 2024) to quantize sentence representations.
ActionPiece. We use encoder-decoder Transformer architecture similar to T5 (Raffel et al., 2020). We use four layers for both the encoder and decoder. The multi-head attention module has six heads, each with dimension of 64. For the public benchmarks "Sports" and "Beauty", we follow Rajput et al. (2023) and set the token embedding dimension to 128 and the intermediate feed-forward layer dimension to 1024. This results in a total of 4.46M non-embedding parameters. For the larger "CDs" dataset, we use a token embedding dimension of 256 and an intermediate feed-forward layer dimension of 2048, leading to 13.1 IM non non-embediing parameters. For model inference, we use beam search with a beam size of 50. Note that the baselines P5-CID, TIGER, and SPM-SID use the same model architecture, differing only in their action tokenization methods. For ActionPiece-speciffi hyperparameters, we set the number of segmentations produced using set permutation regularization during inference to q 5. We tune the vocabulary size in (5k, 10k, 20k, 30k, 40k).
Training. We train the GR models from scratch for up to 200 epochs, using early stopping if the model does not achieve a better NDCG@ 10 on the validation set for 20 consecutive epochs. The training batch size is set to 256. The learning rate is selected from [1 x 10 3 3 x 10 -3 5 x 10-3) with a warmup step of 10,000. We use a dropout rate of 0.1 and tune the weight decay from (0.07, 0.1, 0.15, 0.2). For all methods implemented by us, we conduct five repeated experiments using random seeds {2024, 2025, 2026, 2027, 2028). The model checkpoints with the best average NDCG@ 10 on the validation set are selected for evaluation the test set, and report these results. Each model is trained single 40G NVIDIA A100 GPU.
Inference. The inference process of ActionPiece follows the same procedure as TIGER. The decoder autoregressively generates token sequences representing the target items. During training, we use the original item features as labels, without any augmentation or token merging. At inference time, for each augmented version of a test case, we apply beam search to generate top-ranked token sequences. The most probable sequences (i.e., prefixes) are retained in the beam (with beam size specified in Table 7), and the model continues generating tokens one time until the target sequence length is reached.
21


Reviews:
[{"review_id": "8CL5zhBW7e", "reviewer": "Reviewer_w42X", "summary": "This paper introduces ​ActionPiece, a context-aware action sequence tokenization method for Generative Recommendation (GR). The main contributions are as follows: (1)​Context-aware tokenization, which represents user action sequences as sequences of unordered feature sets and then merges frequently co-occurring feature patterns (both intra-action and cross-action) to build a vocabulary capturing contextual dependencies, enabling distinct tokens for the same action in different contexts. (2) ​Set Permutation Regularization (SPR), leveraging the unordered nature of feature sets by generating multiple semantically equivalent token sequences through random permutations, serving as data augmentation during training and ensemble sources during inference to enhance generalization. \nExperimental results demonstrate ActionPiece’s performance over existing methods (ID-based, feature-enhanced, and GR baselines) on Amazon datasets (Sports,Beauty,CDs), achieving NDCG@10 improvements of 6.00%–12.82%. Ablation studies confirm the necessity of context awareness, weighted co-occurrence counting, and SPR, with the latter boosting token utilization from 56.89% to 87.01%. Inference-time ensemble over 5 permutations balances performance and computational cost. The work pioneers context-aware tokenization in recommendation systems, enabling finer-grained semantic modeling for GR.", "questions": "", "limitations": "", "rating": 3, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "Thank you very much for your time and thoughtful feedback. We greatly appreciate your constructive and insightful suggestions. Below, we address your concerns regarding the experiments, followed by additional discussions.\n\n**Q1: Inconsistent experimental settings**\n\n**A1:** We included results on the CDs dataset to demonstrate performance of compared methods on a large-scale dataset. However, to the best of our knowledge, there are no publicly available results of generative recommendation methods on CDs. Therefore, we carefully followed the same experimental settings used in public benchmarks such as Sports and Beauty to ensure fair comparisons.\n\nWe would like to clarify that the \"CDs\" dataset used in LC-Rec [Zheng et al., 2024] is from a different version of the Amazon Reviews dataset. Specifically, our work uses the Amazon 2014 version, whereas LC-Rec uses a 2018 version.\n\n**Q2: Results on datasets beyond Amazon**\n\n**A2:** Thank you for the suggestion to improve the comprehensiveness of our experimental evaluation. We additionally conducted experiments on another widely used public benchmark Yelp, following the experimental setting in the LETTER [Wang et al., 2024a] paper.\n\n|**Yelp**|**N@10**|\n|-|-|\n|TIGER|0.0213|\n|SPM-SID|0.0226|\n|LETTER|0.0231|\n|ActionPiece|**0.0255**|\n\nThese results demonstrate that ActionPiece achieves better performance than the compared baselines on Yelp as well.\n\n**Q3: Results of TIGER with smaller vocabularies**\n\n**A3:** In our original submission, we compared ActionPiece to both (1) TIGER with larger vocabularies and (2) SPM-SID, aiming to ensure a fair comparison in terms of vocabulary size and to demonstrate that the improvements are not solely due to having more tokens.\n\nWe appreciate the reviewer's insightful suggestion and conduct additional experiments using TIGER variants with smaller vocabulary sizes:\n\n|**Sports**|**N@10**|\n|-|-|\n|TIGER (4×48)|0.0231|\n|TIGER (3×256)|0.0220|\n|TIGER (4x256, original)|0.0225|\n|ActionPiece|**0.0264**|\n\nWhile one TIGER variant with smaller vocabularies can perform slightly better than the numbers reported in the original TIGER paper, ActionPiece still achieves significantly better performance than all TIGER variants.\n\n**Q4: Baselines like IDGenRec and LETTER were not compared**\n\n**A4:** Each generative recommendation baseline in our paper was selected to represent one different tokenization paradigm, consistent with those in Table 1. Our core contribution is to introduce *context-aware* tokenization as a novel and promising paradigm, rather than to claim that ActionPiece is the best action tokenization method.\n\nThat said, we agree that additional comparisons are helpful. Below are the results comparing ActionPiece with IDGenRec (after fixing the data leakage issue in https://github.com/agiresearch/IDGenRec/issues/1):\n\n||**Sports (N@10)**|**Beauty (N@10)**|\n|-|-|-|\n|IDGenRec|0.0223|0.0404|\n|ActionPiece|**0.0264**|**0.0424**|\n\nThe comparison with LETTER has been included in our response to **Q2** above.\n\n**Q5: Tokenize inherently ordered features**\n\n**A5:** Thank you for highlighting this important direction. Injecting hierarchical structure into the tokenization process is indeed a challenging task for most existing action tokenization methods, especially those that rely on quantization techniques. While text-based tokenization can naturally capture such hierarchies, it suffers from tokenization inefficiencies. We will discuss these limitations and the trade-offs in the final version of the paper.\n\n**Q6: Efficiency of set permutation regularization (SPR)**\n\n**A6:** In terms of training, the efficiency is comparable to existing methods. The feature permutation operations are performed on the CPU and run asynchronously alongside GPU-based model updates.\n\nFor inference, while SPR introduces additional computational overhead in terms of FLOPs, the latency remains comparable. This is because the augmented versions of each test case can be processed in parallel across multiple GPUs, resulting in inference latency that is comparable to the non-augmented single-GPU setting.\n\n**Q7: Details of the inference process**\n\n**A7:** Our model inference process follows TIGER. The decoder autoregressively generates token sequences for the target items. During training, we use the original item features as labels without any augmentation or token merging. At inference time, we apply beam search to generate the top-ranked token sequences. The most probable token sequences (in other words, prefixes) are retained in the current beam (with beam size detailed in Table 7), and the model continues generating tokens one at a time until the desired generation length is reached.\n\n**Q8: Formatting issues in Algorithm 2 and Figure 3**\n\n**A8:** Thank you for your careful and detailed review. We appreciate your effort in catching these formatting issues and will address them in the final version.", "claims_and_evidence": "This paper demonstrates stable improvements of the proposed method across three datasets compared to ID-based, feature-enhanced, and generative baselines. The results align with the claim that context-aware tokenization improves performance. The inclusion of ablation studies further validates the necessity of key components like context-aware merging and SPR. However, some baseline results from Sports and Beauty datasets are directly taken from original papers, while the results in CDs dataset are reimplemented, which may result in inconsistency.", "methods_and_evaluation_criteria": "This paper introduces ActionPiece, a context-aware tokenization method for generative recommendation (GR) systems. Overall, the proposed method is effective but has certain limitations:\n1. Contextual Action Sequence Tokenization: Representing actions as unordered feature sets and merging co-occurring features (within or across adjacent actions) into context-sensitive tokens during vocabulary construction. While this method incorporates contextual information, it fails to model inherently ordered features (e.g., Cosmetics → Lip Products → Lipstick), which naturally follow hierarchical dependencies.\n2. Set Permutation Regularization (SPR): Generating multiple semantically equivalent token sequences by permuting features within sets, enhancing training through data augmentation and inference via ensemble predictions. Although experimentally proven effective, SPR may introduce additional computational overhead, impacting overall system efficiency.\n3. Efficient Implementation: Using linked lists and lazy-update heaps to optimize vocabulary construction, accelerating algorithmic execution.\nThe selected benchmarks are reasonable but lack diversity. While Amazon Benchmarks (Sports, Beauty, CDs) are standard datasets in recommendation research, this paper does not evaluate performance on datasets beyond the Amazon domain.", "theoretical_claims": "The theoretical claims in this paper primarily focus on  weighted co-occurrence counting  and  time complexity calculation, with the logic being rigorously structured and the derivations mathematically sound.", "experimental_designs_or_analyses": "I have thoroughly reviewed the experimental section of this paper. Overall, the experimental design is largely reasonable, but certain limitations still exist. In the main experiments, the proposed method achieves state-of-the-art performance; however, there is inconsistency in baseline results across different datasets as has been mentioned before. The ablation study validates the effectiveness and scalability of each component of the method. However, TIGER achieves optimal results under a vocabulary size of 4×2^8, which suggests that smaller vocabulary sizes might yield better performance, which may result in unfairness in the main experimental comparisons. Additional experiments analyze the method’s performance under varying parameters, and their design and conclusions are generally well-founded.", "relation_to_broader_scientific_literature": "None", "essential_references_not_discussed": "This paper comprehensively cites relevant works that provide necessary context for its key contributions.", "other_strengths_and_weaknesses": "1.The details of the inference process need to be further explained.", "other_comments_or_suggestions": "1.There is an issue with line numbering in Algorithm 2 in the appendix.\n2.The first letter in Figure 3 should be capitalized.", "questions_for_authors": "1.How does set permutation affect training and inference efficiency?\n2.Why are some papers (e.g. IDGenrec in [Tan et al., 2024;] and LETTER in [Wang et al., 2024a] ) with better performance cited but not included in the baseline comparison?", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {"ethical_review_concerns": "None"}}, {"review_id": "Wg0iFwVPGW", "reviewer": "Reviewer_yBx7", "summary": "this paper proposed ActionPiece, a tokenization strategy for generative recommendation systems. the main idea of ActionPiece can be summarized as following: after collecting all features of each action set, the authors proposed to reconstruct the user historical action sequences by i) vocabulary construction: use simple counting to compute the co-occurrence of existing tokens and update token pairs based on the co-occurrence. ii) segmentation: generate random permutation and apply BPE. A transformer encoder-decoder model is trained on top of the proposed tokenization technique and experiments on 3 amazon recommendation datasets were reported to show that the proposed tokenization technique outperforms existing baselines.", "questions": "", "limitations": "", "rating": 3, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "We sincerely thank the reviewer for the thoughtful and constructive feedback. We appreciate your recognition of the intuition, simplicity, and effectiveness of ActionPiece tokenization technique.\n\n**Q1: On experiments with industrial-scale datasets or online A/B testing**\n\n**A1:** We acknowledge the reviewer's concern regarding the absence of industrial-scale experiments. Due to resource constraints, we were unable to run experiments on industrial-scale offline datasets or perform online A/B tests. However, to address the scalability concern, we included the CDs dataset in our evaluation, which contains over 1 million user-item interactions. To our knowledge, this dataset is among the largest publicly available datasets used for studying generative recommendation or action tokenization methods.\n\n**Q2: On set permutation regularization (SPR)**\n\n**A2:** SPR benefits the model from multiple perspectives:\n\n* *Token utilization perspective:*\n\n    SPR effectively prevents the features of a single action from being consistently merged into the most compressed (high-level) tokens. Instead, it allows the action to be tokenized into both high-level and low-level tokens, depending on the permutation and token merging rules. This increases the number of tokens actively involved during both training and inference. As shown in Figure 5 and discussed in Section 4.4.2, SPR significantly improves token utilization - from 56.89% to 95.33% by the 5th epoch - indicating that a greater proportion of tokens are trained after applying SPR.\n\n* *Data augmentation perspective:*\n\n    From the perspective of data augmentation, SPR enriches the token sequences available for model training. Without SPR, each action sequence can only be tokenized into a single, fixed token sequence. In contrast, SPR allows each action sequence to be tokenized in multiple ways (as shown in Figure 1). While these augmented sequences preserve the same semantic information, they expose the model to richer token patterns. Training on these diverse token sequences helps the model generalize better, as evidenced by the performance of variant (3.1) in Table 3.\n\n* *Ensemble perspective:*\n\n    SPR also enables inference-time augmentation. A given input action sequence can be augmented into multiple token sequences during inference. Each sequence may yield a different ranking of the next possible items. By ensembling these recommendation results, overall performance can be enhanced, as demonstrated by variant (3.2) in Table 3 and further illustrated in Figure 6.\n\nWe thank the reviewer again for their helpful comments. We will incorporate the above clarifications and discussions in the final version of the paper.", "claims_and_evidence": "Yes.", "methods_and_evaluation_criteria": "Yes.", "theoretical_claims": "No theoretical results were provided.", "experimental_designs_or_analyses": "yes", "relation_to_broader_scientific_literature": "None", "essential_references_not_discussed": "None.", "other_strengths_and_weaknesses": "Strengths:\n- the proposed tokenization technique provides great intuition how to restructuring the user historical sequence by combining the tokenization ideas from LLM.\n- the proposed method is based on counting, merging and BPE, which are simple and easy to understand.\n- the proposed method achieves the best performance on several public datasets.\n\n\nWeaknesses：\n- the experiments were conducted on small datasets. no results on industrial scale recommendation systems were reported. this makes the ideas of the paper weaker since it hasn't been tested in real world.\n- no theoretical justifications.", "other_comments_or_suggestions": "None", "questions_for_authors": "- can the authors comment more on \"Set permutation regularization\"? specifically, why random permutation of each action set is critical to the performance improvement.", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {"ethical_review_concerns": "none"}}, {"review_id": "pDUMfjPhiG", "reviewer": "Reviewer_jhbj", "summary": "This paper introduces ActionPiece, a novel tokenization method for generative recommendation systems that incorporates context when tokenizing user actions. Unlike existing approaches (RQ-VAE, etc.) that tokenize each action independently, ActionPiece represents actions as unordered feature sets and builds a vocabulary by merging frequently co-occurring feature patterns both within individual actions and across adjacent actions. The authors also introduce set permutation regularization to handle the unordered nature of feature sets, enabling data augmentation during training and ensemble prediction during inference.\n\nExperiments on three Amazon Review datasets demonstrate that ActionPiece consistently outperforms existing tokenization methods, improving NDCG@10 by 6.00% to 12.82%. Detailed analyses show that ActionPiece achieves significantly higher token utilization rates (up to 95.33%) and creates more efficient tokenized sequences. The authors validate their approach with thorough ablation studies.", "questions": "", "limitations": "", "rating": 3, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "We thank the reviewer for the valuable feedback! Below, we first provide a detailed example of learned vocabulary, followed by clarifications regarding the experiments and method design.\n\n**Q1: Example of learned vocabularies**\n\n**A1:** As detailed in Section E, we use vector-quantized (VQ) tokens as item features. We also add an extra token per item to avoid conflicts. Thus, each item is associated with a total of 5 features: 4 VQ tokens and one extra token. The union of these tokens forms the initial vocabulary of ActionPiece. Notably, we do not use raw item IDs or raw text tokens.\n\nTo further clarify, we provide a concrete example from the Sports dataset. The item-to-feature mapping looks like:\n\n|**Item ID**|**Features**|\n|-|-|\n|B000BS0I2G|[170, 438, 519, 820, 1127]|\n|B000XHGE00|[163, 398, 564, 1023, 1068]|\n|...|...|\n\nThe ActionPiece vocabulary is constructed by iteratively merging token pairs into new tokens. Each row in the table below represents a merge rule, sorted by the order in which the rules were learned:\n\n|**Source Tokens**|**Target Token**|\n|-|-|\n|(363, 763)|1154|\n|(269, 515)|1155|\n|...|...|\n|(465, 1202)|1204|\n|(369, 760)|1205|\n|...|...|\n|(241, 1040)|39999|\n|(30314, 39998)|40000|\n\nThe final vocabulary consists of 1153 initial tokens (4×256 VQ tokens, 128 extra tokens, and 1 padding token) and merging rules.\n\nWe promise to release our code and constructed vocabularies, allowing others to reproduce and extend our work.\n\n**Q2: Experiments with vocabulary size > 40k**\n\n**A2:** We agree that experimenting with larger vocabulary sizes would make our study more comprehensive. We conducted experiments on the Sports dataset:\n\n|**Vocab Size**|**N@10**|\n|-|-|\n|40k|0.0264|\n|60k|0.0260|\n|80k|0.0269|\n|100k|0.0266|\n\nAs shown, increasing the vocabulary size does not consistently improve performance, suggesting that larger vocabularies may lead to overfitting.\n\n**Q3: More ablation study with SPR**\n\n**A3:** To further understand SPR's impact, we introduce two additional ablation variants on the Sports dataset by applying SPR to:\n1. TIGER\n2. Variant (2.1), which uses only the initial tokens (without merging).\n\n|**Method**|**N@10**|\n|-|-|\n|TIGER|0.0225|\n|TIGER + SPR|0.0202|\n|(2.1)|0.0215|\n|(2.1) + SPR|0.0205|\n\nAs we can see, directly applying SPR leads to degraded performance in both cases. This suggests that SPR alone is not sufficient to improve generative models, regardless of whether the tokens are ordered or unordered.\n\n**Q4: Gains of contextual tokenization seem small**\n\n**A4:** Note that Sports and Beauty have relatively short sequence lengths (8.32 and 8.87 actions per sequence). In contrast, CDs has longer sequences, averaging 14.58 actions per sequence. Longer sequences offer more opportunities to leverage contextual information during tokenization. As expected, the performance gap between variant (2.2) and ActionPiece is more pronounced on CDs.\n\n**Q5: Handling high cardinality features like item IDs**\n\n**A5:** As mentioned in **A1**, we add one extra token per item, which allows us to uniquely index each item. This design eliminates the need to explicitly incorporate item IDs. Likewise, for other high-cardinality features, we can adopt a joint indexing mechanism as well, representing each feature using a combination of tokens from shared vocabularies.\n\n**Q6: Order within an action vs. across actions**\n\n**A6:** Item features such as title or price typically do not have an inherent ordering relative to one another. In sequential recommendation, the historical actions of a user are typically ordered by timestamp to capture behavioral dynamics. Therefore, we preserve and use the temporal order of actions in the sequence. Intuitively, while features within an action are unordered, the composition of those features across time can still reflect sequential patterns.\n\n**Q7: Comparison with text tokenization methods like SentencePiece**\n\n**A7:** While ActionPiece can be viewed as a variant of SentencePiece that relaxes the order constraints among features within each action, this relaxation is both non-trivial and beneficial. Modeling each action as an unordered set aligns better with the inherent structure of the data and leads to improved performance. To enable effective tokenization under this setup, we introduce techniques such as weighted counting and SPR. Ablation studies show that removing any of these components results in a performance drop.\n\n**Q8: Complexity of modeling contextual information**\n\n**A8:** We acknowledge that ActionPiece introduces additional complexity. This mirrors the evolution seen in language modeling: when subword methods like BPE were first introduced, they were also considered more complex than word- or character-level tokenization. Yet, over time, such methods proved to be significantly more effective and have become standard in modern NLP pipelines. Similarly, we argue that context-aware tokenization is a necessary step forward for effectively modeling action sequences.", "claims_and_evidence": "* Tokenization is an important topic in RecSyS, esp. given recent focus on generative recommendations. Prior work has primarily studied either VQ/RQ-based quantization or directly utilizing raw ids.\n\t* (+) This paper proposes a new direction, tokenization in the (unordered) feature space, and validates that this results in significantly higher token utilization rate (56.9% -> 95.3%, Figure 5, Section 4.4.2) and better results esp when this tokenization strategy is combined with set permutation regularization (Table 4).\n* Contextual tokenization is presented as a major contribution of this work, but the gains seem small from Table 3 (2.2).\n\t* (-) I also struggle to understand what exactly these contextual tokens look like for Amazon Review datasets; Section 4.5 doesn't quite help given I thought these datasets are text-/id-only. It would be valuable to present examples in the Appendix.", "methods_and_evaluation_criteria": "Proposed methods:\n* (+) Directly combining features into tokens (WordPiece/SentencePiece style) is an understudied problem in RecSys, and the authors have shown that this has benefits on some Amazon Review datasets. \n* (-) I would like to see clearer examples illustrating how this work in practice (eg what the learned tokens look like). \n* (-) How would ActionPiece scale to high cardinality id vocabularies (eg video ids), which is the most popular tokenization method in RecSys?\n\nEvaluation Criteria:\n* (+) The evaluation methods used, including normalized sequence length (NSL, Figure 4) to measure tokenization efficiency, token utilization rate to assess vocabulary usage (Figure 5), and comparison against both ID-based methods, RQ-VAE based methods, and other GR approaches on NDCG (Table 2) generally make sense. I appreciate the authors conducting thorough studies on NSL and utilization rate in particular.", "theoretical_claims": "* I checked the time complexity analyses in the paper and they appear correct to me.", "experimental_designs_or_analyses": "The experiment designs are generally thorough. Two issues:\n* Figure 4: Why is the maximal vocabulary size limited to 40K? I would expect a point where the performance with large vocabularies starts to degrade due to overfitting. \n* Table 3: It would be valuable to present results without either (3.1) or (3.2). This is because for sparse datasets like Sports or Beauty, SPR itself would be a valuable technique.", "relation_to_broader_scientific_literature": "* w.r.t. RecSys, studies of alternative tokenization methods besides RQ-VAE and raw ids is important given recent focus on sequential/generative recommendations.\n* w.r.t. NLP, the method seems like a natural extension of SentencePiece to RecSys. However I'm confused why the authors would drop ordering within an \"Action\" and introduce ordering across \"Action\"s.", "essential_references_not_discussed": "* N/A", "other_strengths_and_weaknesses": "N/A", "other_comments_or_suggestions": "N/A", "questions_for_authors": "* How effective is feature merging when features are of very high cardinality, which is typical for sparse id features (eg video ids)? This also may make some design choices impractical, eg \"maintaining a hashtable to store co-occurrences of token pairs\"\n* When the inputs are all text, is ActionPiece fundamentally different from SentencePiece besides dropping the order constraints?  Could the authors provide examples of learned vocabularies for Sports/Beauty/CDs under ActionPiece for inspection?\n* The way context information is incorporated in this paper is to merge features across adjacent \"Actions\", which seems to introduce a lot of complexity. How much value does this add?", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "AsEWyATOXA", "reviewer": "Reviewer_DB8e", "summary": "The paper addresses a common limitation in existing generative models, where actions are tokenized independently. To resolve this issue, the paper introduces ActionPiece, a novel method that explicitly incorporates contextual information when tokenizing action sequences. Experimental results on public datasets show that ActionPiece consistently outperforms existing action tokenization methods.", "questions": "", "limitations": "", "rating": 4, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "We thank the reviewer for their thoughtful suggestions! Below, we address the questions listed under \"Questions for Authors\", followed by further discussion on related topics.\n\n**Q1: Why are token pairs between adjacent actions assigned lower weights?**\n\n**A1:** First, we'd like to clarify that token pairs between adjacent actions are not always assigned lower weights compared to token pairs within an action.\n\nFor example, consider an action A with 8 features and an adjacent action B with 3 features. Then:\n* The weight for token pairs between actions A and B is:\n$\\frac{1}{8 \\times 3} = \\frac{1}{24}$\n* The weight for token pairs within action A is:\n$\\frac{1}{\\binom{8}{2}} = \\frac{1}{28} < \\frac{1}{24}$\n\nThis illustrates that in some cases, cross-action token pairs actually receive higher weights than within-action pairs.\n\nMore broadly, the weighting scheme is designed to reflect the expected probability that two tokens co-occur as neighbors in the flattened sequence, where tokens in each action (set) are randomly permuted. As a result, the final weight depends on the size of the involved feature sets. For a detailed explanation, please refer to \"Section 3.2.1 - Weighted co-occurrence counting\".\n\n**Q2: Performance w.r.t. the number of backbone model parameters**\n\n**A2:** Thank you for the suggestion. We conducted experiments to study the impact of backbone model size on performance. Specifically, we evaluated three model variants with varying parameter numbers:\n\n|**Variant**|**#Parameters**|**d_model**|**d_ff**|**num_layers**|**num_heads**|\n|-|-|-|-|-|-|\n|small|2.89M|64|256|2|2|\n|base|9.58M|128|1024|4|6|\n|large|23.35M|256|2048|4|6|\n\nWe tested these variants on a small dataset (Sports) and a large dataset (CDs), with results summarized below:\n\n||**Sports (N@10)**|**CDs (N@10)**|\n|-|-|-|\n|small|0.0261|0.0289|\n|base|**0.0264**|0.0416|\n|large|0.0242|**0.0451**|\n\nThese results indicate that performance is influenced by both dataset size and model size (under a fixed number of tokens). On the smaller Sports dataset, the base model performs best, while the large model shows signs of overfitting. On the larger CDs dataset, the large model achieves the best performance, suggesting the dataset is sufficiently large to benefit from increased model size.\n\n**Q3: LLM-based sequential recommendation**\n\n**A3:** Thank you for the valuable suggestion. While our paper primarily focuses on action tokenization methods, LLM-based sequential recommendation is indeed closely related. Below is a high-level discussion of its relevance and connection to our work:\n\nWhen aligning LLMs with user preferences for sequential recommendation through instruction tuning on historical action sequences, the way these actions are tokenized plays a crucial role. We identify three main paradigms:\n1. Text-based tokenization: Each action is represented as a textual string, which aligns naturally with LLMs' input modality. However, this approach leads to significantly long token sequences, resulting in both tokenization inefficiency and high inference latency.\n2. Dense vector representations: Actions are represented as dense vectors, typically derived from pretrained semantic encoders or embedding tables. While this method is more efficient in terms of sequence length, it faces memory and scalability issues, especially since the number of items often exceeds the typical token vocabulary size of LLMs. Aligning LLMs with these continuous representations poses challenges in both engineering and optimization.\n3. Discrete tokenization: Actions are tokenized into short sequences of discrete tokens drawn from a compact shared vocabulary (usually much smaller than that of typical LLMs). This strikes a balance between token length and memory efficiency, making it a practical solution for building LLM-based recommendation systems.\n\nWe appreciate the reviewer's input and will include a more detailed discussion of LLM-based sequential recommendation in the final version, with proper citations to relevant literature.\n\n**Q4: Cross-dataset pretraining**\n\n**A4:** Thank you for highlighting this direction. While the transfer learning paradigm - pretraining on a diverse collection of datasets followed by fine-tuning on new datasets or platforms - has shown promising in retrieval-based recommendation methods (e.g., VQ-Rec [Hou et al., 2023]), it remains an open challenge for generative recommendation models.\n\nTo the best of our knowledge, there is currently no existing work that successfully applies generative models with action tokenization to this pretraining - fine-tuning paradigm. Nevertheless, we agree this is an important and exciting research direction. We will clarify this point in the final version and plan to explore it further in future work.", "claims_and_evidence": "Yes, the claims made in the submission are supported by clear and convincing evidence.", "methods_and_evaluation_criteria": "Yes, the proposed methods and evaluation criteria are well-suited for the problem at hand.", "theoretical_claims": "The paper does not provide proofs for the theoretical claims it presents.", "experimental_designs_or_analyses": "The experimental design of the paper is reasonable and well-structured. The authors conduct comprehensive ablation studies that effectively validate the importance of constructing a context-aware tokenizer.", "relation_to_broader_scientific_literature": "This paper introduces and extends previous encoding methods used in recommendation tasks, enhancing the richness of the encoded content. The tokenization method proposed in the paper is, to some extent, inspired by research in the field of natural language processing (NLP).", "essential_references_not_discussed": "LLMs-based sequence recommendation methods.", "other_strengths_and_weaknesses": "Strengths:\n\n1. The motivation behind the paper is well-founded, and the proposed method is novel. It introduces the innovative idea of considering encoding contextual information, which allows for the inclusion of more features to be learned together, enhancing the effectiveness of the tokenization process.\n2. The paper is logically rigorous in its writing, with a thorough experimental process that supports the claims made in the study. \n\nWeaknesses:\n1. The paper does not discuss other sequence recommendation methods that use large language models (LLMs) as backbones. \n\n2. The paper does not attempt cross-dataset pretraining to validate the generalization ability of the model.", "other_comments_or_suggestions": "1. Exploring LLMs-based sequence recommendation methods could provide a broader perspective on the potential applications and improvements of the proposed technique.\n\n2. Evaluating the training on cross-domain datasets could help demonstrate its robustness and generalization across different use cases.", "questions_for_authors": "1. When computing token co-occurrence statistics, why are token pairs between adjacent actions assigned lower weights?\n2. Would the recommendation performance improve as the number of parameters in the backbone increases? Could you provide experimental validation for this?", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}]

Author rebuttal:

Meta-review: The authors provide novel contributions to the nascent but fast growing field of Generative Recommendation models.  In response to reviewer concerns, the authors provided a solid and convincing rebuttal and hence there is general agreement from the reviewers that the work should be accepted.  

Reviewers would like to see the additional discussion and results discussed in the rebuttal incorporated into the paper Appendices and referenced in the main text where relevant.  

Two particular points stood out in post-rebuttal discussion that I would like to highlight as the authors make final revisions:

1. **The motivation and need for context-awareness**:  The ablation studies in Table 3 appear to show little degradation when context-awareness is removed, yet the paper appears to strongly argue for its importance.  The authors are requested to revisit their motivation and arguments in light of their experimental results to ensure they are correctly motivating and highlighting the key components that are empirically validated to offer the largest gains.  


   To this broader point of framing the motivation and argumentation correctly, one reviewer comments: "even ignoring 'contextual tokenization', the authors are more or less learning *explicit feature crosses* with their proposed token merging algorithm, which should be a strict improvement over prior work that constructs codebook solely based on RQ-VAE".

2. **Concerns about reproducibility**:  One reviewer comments that reproduction of the proposed token merging logic would take a lot of work.  No code was made available with the paper submission, but I strongly encourage the authors to make an effort to allow reproduction of their work for the sake of future papers that would like to extend this paper and compare to its results.
Decision: Accept (spotlight poster)