# uber-research/PPLM

Plug and Play Language Model implementation. Allows to steer topic and attributes of GPT-2 models.

Repository: https://github.com/uber-research/PPLM
Canonical: https://ross.abutalabs.com/products/pplm
Language: Python
License: Apache-2.0
License Family: permissive
Topics: language-modeling, natural-language-generation, machine-learning, deep-learning, natural-language-processing, nlp
Last push: 2024-02-20T16:47:37+00:00

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

## Adoption (not part of the score)
Stars 1153, forks 203 (observed 2026-08-28T04:03:47.279931+00:00)

## What it is
PPLM (Plug and Play Language Model) is a research implementation for controlled text generation that steers the topic and attributes of GPT-2 outputs using small attribute models, without training or fine-tuning the base language model. It was published by Uber AI at ICLR 2020 and is also integrated into Hugging Face Transformers.

## Use cases
- steer GPT-2 text generation toward a specific topic
- control attributes of generated text without fine-tuning the language model
- run bag-of-words topic-controlled generation with run_pplm.py
- use PPLM as a baseline for controlled text generation research
- experiment with discriminator-based attribute steering of language models
- try controlled text generation in a Colab notebook without setup

## When to choose
- you need topic- or attribute-controlled generation from GPT-2 without retraining
- you are reproducing the PPLM paper or using it as a research baseline
- you want to plug in small attribute models into a frozen language model

## When to avoid
- you need controlled generation with modern LLMs beyond GPT-2
- you want a production-ready, actively maintained text generation library
- you prefer fine-tuning or prompt-based steering approaches instead of gradient-based control

## Facets
- artifact type: library
- maturity: maintenance
- function: nlp, machine-learning, llm-inference
- domain: machine-learning, deep-learning, large-language-models
- platform: python
- tags: controlled-text-generation, gpt-2, attribute-steering, research-code, language-models, natural-language-processing

## Member repositories
- uber-research/PPLM (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:47.279931+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-30T06:33:30.119298+00:00, confidence not recorded.
  - readme: https://github.com/uber-research/PPLM (fetched 2026-08-28T04:03:47.279931+00:00, sha 3e9ca2240631)
- Data as of 2026-08-30T08:39:29.467469+00:00.
