Downloads · 30 days
0
0% of all-time downloads
NoeFlandre/fineweb-legal-classifier
fineweb-legal-classifier is a machine learning model from NoeFlandre. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as mit.
<center <img src="https://raw.githubusercontent.com/NoeFlandre/fineweb-legal/main/assets/logo.png" alt="FineWeb-Legal Logo" width="400"/ </center
Downloads · 30 days
0
0% of all-time downloads
All-time downloads
10
Public
Repo size
82.9 MB
Likes
1
Public
Click a slice to open those files.
.safetensors98.6 MB · 99%
From the Hugging Face model README
This repository contains ablation study results for the FineWeb-Legal classifier project. We systematically tested hyperparameters to identify the optimal configuration for legal document classification.
Legal documents are long. We tested context windows from 512 to 2048 tokens.
| Context Window | Macro F1 | Accuracy | Binary F1@3 | Impact |
|---|---|---|---|---|
| 512 | 0.5797 | 0.606 | 0.8534 | ❌ Too short |
| 1024 | 0.6645 | 0.721 | 0.9200 | Baseline |
| 2048 | 0.6715 | 0.742 | 0.9177 | ✅ Winner |
Conclusion: Increasing to 2048 tokens provides the most significant boost (+1.05% Macro F1).
Tested from 1e-4 to 1e-3.
| LR | Macro F1 | Accuracy | Binary F1@3 | Notes |
|---|---|---|---|---|
| 1e-4 | 0.6548 | 0.708 | 0.9074 | Underfitting |
| 2e-4 | 0.6645 | 0.721 | 0.9200 | Stable |
| 5e-4 | 0.6655 | 0.725 | 0.9200 | Best |
| 1e-3 | 0.6644 | 0.719 | 0.9176 | Diminishing returns |
Conclusion: 3e-4 to 5e-4 is optimal.
Testing adapter capacity.
| Rank | Macro F1 | Accuracy | Binary F1@3 | Notes |
|---|---|---|---|---|
| 8 | 0.6406 | 0.688 | 0.9074 | Underfitting |
| 16 | 0.6645 | 0.721 | 0.9200 | Optimal |
| 32 | 0.6645 | 0.721 | 0.9200 | No gain, higher VRAM |
Conclusion: Rank 16 is the sweet spot.
| Configuration | Macro F1 | Accuracy | Binary F1@3 |
|---|---|---|---|
| No Weights | 0.6635 | 0.719 | 0.9200 |
| With Weights | 0.6645 | 0.721 | 0.9200 |
Conclusion: Class weights improve performance on imbalanced data.
Based on these studies, the recommended V2 configuration is:
google/embeddinggemma-300mablation_results/
├── lr_1e-4/ # Learning rate experiments
├── lr_2e-4/
├── lr_5e-4/
├── lr_1e-3/
├── lora_r8/ # LoRA rank experiments
├── lora_r16/
├── lora_r32/
├── seq_512/ # Sequence length experiments
├── seq_1024/
├── seq_2048/
├── with_weights/ # Class weight experiments
├── no_weights/
└── master_summary.json
Each experiment folder contains:
results.json - Performance metricsconfig.json - Hyperparameters usedmodel/ - Trained LoRA adaptersconfusion_matrix.npy - Confusion matrixclassification_report.txt - Detailed metricsAll experiments used:
google/embeddinggemma-300mMIT License.