Hugging Face Transformers adopts single model file policy—centralized DRY no longer applied
AI Impact Summary
The Transformers project consciously rejects DRY in favor of a single model file policy, placing all forward-pass logic into one file per model (e.g., modeling_bert.py). This increases per-model readability and contributor locality but raises maintenance risk because identical sub-components (like attention) may be duplicated across models, making cross-model bug fixes and updates more manual. For teams integrating or extending models (BERT, T5, Reformer, Longformer, BigBird, DeBERTa, DeBERTa-v2), expect higher review overhead and potential inconsistencies when evolving foundational components. The change shifts maintenance from a centralized shared module to model-specific code paths, affecting how quickly global improvements propagate.
Affected Systems
- Date
- Date not specified
- Change type
- capability
- Severity
- info