# NVIDIA-Merlin/Transformers4Rec

Transformers4Rec is a flexible and efficient library for sequential and session-based recommendation and works with PyTorch.

Repository: https://github.com/NVIDIA-Merlin/Transformers4Rec
Canonical: https://ross.abutalabs.com/products/transformers4rec
Homepage: https://nvidia-merlin.github.io/Transformers4Rec/main
Language: Python
License: Apache-2.0
License Family: permissive
Topics: transformer, pytorch, tabular-data, huggingface, bert, gtp, language-model, xlnet, nlp, seq2seq, recsys, recommender-system, session-based-recommendation
Last push: 2026-08-23T02:54:09+00:00

## Health v2 (maintenance only)
Score: 67/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 8, longevity 100
- inputs: {"age_days": 1967, "days_push": 10, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1282, forks 165 (observed 2026-08-28T04:04:14.010515+00:00)

## What it is
Transformers4Rec is a Python library by NVIDIA for sequential and session-based recommendation using transformer architectures, bridging NLP and recommender systems via integration with Hugging Face Transformers. It works with PyTorch to model sequences of user interactions and predict the next item.

## Use cases
- build session-based recommendations for anonymous e-commerce visitors
- predict the next item a user will interact with from their click sequence
- apply transformer architectures like BERT or XLNet to recommendation tasks
- model sequential user behavior with tabular interaction data
- handle interest drift by recommending from the current session only
- research next-item prediction with state-of-the-art sequence models

## When to choose
- you need sequential or session-based recommendation with transformer models in PyTorch
- you want to leverage Hugging Face Transformers architectures for RecSys
- your users browse anonymously so only current-session interactions are available
- you're a researcher or practitioner applying NLP sequence models to recommendations

## When to avoid
- you need simple collaborative filtering without sequence modeling
- your stack is TensorFlow-only since the library now focuses on PyTorch
- you need a turnkey hosted recommendation service rather than a modeling library

## Facets
- artifact type: library
- maturity: maintenance
- function: machine-learning, deep-learning
- domain: machine-learning, deep-learning, large-language-models, e-commerce
- platform: python
- tags: recommender-systems, sequential-recommendation, session-based-recommendation, huggingface-transformers, pytorch, nvidia-merlin, tabular-data, gpu

## Member repositories
- NVIDIA-Merlin/Transformers4Rec (main) score 67

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:14.010515+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:57:40.098209+00:00, confidence not recorded.
  - readme: https://github.com/NVIDIA-Merlin/Transformers4Rec (fetched 2026-08-28T04:04:14.010515+00:00, sha e96fce924211)
  - homepage: https://nvidia-merlin.github.io/Transformers4Rec/main (fetched 2026-08-29T12:12:51.988513+00:00, sha 8c28d3d20fc8)
  - registry_pypi: https://pypi.org/pypi/transformers4rec/json (fetched 2026-08-29T12:12:51.997792+00:00, sha 63895ecb9e10)
- Data as of 2026-08-30T08:39:29.467469+00:00.
