Skip to content

Conversation

behroozazarkhalili
Copy link
Collaborator

@behroozazarkhalili behroozazarkhalili commented Oct 9, 2025

Analysis: examples/research_projects/

📁 Directory Structure

examples/research_projects/
├── README.md
├── layer_skip/ (Added March 2025 - PR #3111)
├── stack_llama/ (Added July 2023 - PR #509)
├── stack_llama_2/ (Added July 2023 - PR #509)
└── toxicity/ (Added July 2023 - PR #509)

🔍 Usage Analysis

Documentation References:

  • docs/source/example_overview.md:77 - Links to research_projects
  • docs/source/detoxifying_a_lm.md:11-12 - Links to toxicity scripts
  • docs/source/peft_integration.md:10-12 - Links to stack_llama scripts

CI/CD Integration:

  • ❌ NOT tested in .github/workflows/
  • ❌ NOT referenced in Makefile
  • ❌ NO automated validation

Obsolescence Evidence

1. Broken API Usage:

# examples/research_projects/stack_llama/scripts/rl_training.py:77-79
config = PPOConfig(
    steps=script_args.steps,           # ❌ Parameter removed
    model_name=script_args.model_name, # ❌ Parameter removed
    ...
)

Current PPOConfig: No longer accepts steps or model_name parameters (confirmed via inspection - 163 total params, neither exists)

2. Deprecated Imports:

from trl.core import LengthSampler  # All examples use this
from trl import PPOTrainer, PPOConfig, AutoModelForCausalLMWithValueHead

3. Ancient Code Patterns (Last meaningful update: July 2023):

  • Stack-Llama: Original RLHF pipeline from 2023
  • Toxicity: PPO detoxification from 2023
  • Stack-Llama-2: Llama 2 variants from 2023
  • Layer-Skip: Added March 2025 (only recent one)

📊 Maintenance Status

Project Created Last Updated Functionality
stack_llama July 2023 ~2 years ago ❌ Broken API
stack_llama_2 July 2023 ~2 years ago ❌ Broken API
toxicity July 2023 ~2 years ago ❌ Broken API
layer_skip March 2025 Recent ⚠️ May work

Assessment

Reasons for removal:

  1. Non-functional: 3/4 projects use obsolete TRL API
  2. Unmaintained: No CI testing, no validation
  3. Misleading: Documentation links to broken code
  4. Against Library Vision: TRL moving beyond research-only focus
  5. Better Alternatives: Modern examples exist in examples/scripts/

Changes

  • Removed examples/research_projects/ directory (21 files, 2116 deletions)
  • Updated docs/source/example_overview.md to remove reference
  • Updated docs/source/detoxifying_a_lm.md to remove broken script links
  • Updated docs/source/peft_integration.md to remove broken script links

The research_projects directory contains outdated examples that no longer work with the current TRL API.
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

behroozazarkhalili added 2 commits October 9, 2025 12:39
- Deleted docs/source/detoxifying_a_lm.md as requested by qgallouedec
- Removed reference from docs/source/_toctree.yml

This resolves qgallouedec's review comment on PR #4243.
# Conflicts:
#	docs/source/detoxifying_a_lm.md
#	docs/source/example_overview.md
#	docs/source/peft_integration.md
#	examples/research_projects/stack_llama_2/scripts/README.md
behroozazarkhalili and others added 4 commits October 10, 2025 05:59
Remove trailing space from line 22 that was introduced during merge
with PR #4235 (markdown style enhancements).

This addresses qgallouedec's review comment requesting to revert
unrelated style changes.
Copy link
Member

@qgallouedec qgallouedec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @sergiopaniego, @burtenshaw, we are removing these two-and-a-half-year-old examples. I'll leave it up to you to decide whether it would be wise to provide an updated version somewhere, at some point.

@qgallouedec qgallouedec merged commit bcd059a into main Oct 10, 2025
10 of 12 checks passed
@qgallouedec qgallouedec deleted the remove-research-projects branch October 10, 2025 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants