Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,63 +1,59 @@
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
model_name: ces_phase3b_lora
|
| 5 |
tags:
|
| 6 |
-
-
|
| 7 |
- lora
|
| 8 |
-
-
|
| 9 |
-
-
|
| 10 |
-
-
|
|
|
|
| 11 |
- unsloth
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
| 13 |
pipeline_tag: text-generation
|
| 14 |
---
|
| 15 |
|
| 16 |
-
#
|
| 17 |
|
| 18 |
-
|
| 19 |
-
It has been trained using [TRL](https://github.com/huggingface/trl).
|
| 20 |
|
| 21 |
-
##
|
| 22 |
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
generator = pipeline("text-generation", model="None", device="cuda")
|
| 28 |
-
output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
|
| 29 |
-
print(output["generated_text"])
|
| 30 |
-
```
|
| 31 |
-
|
| 32 |
-
## Training procedure
|
| 33 |
-
|
| 34 |
-
|
| 35 |
|
|
|
|
| 36 |
|
| 37 |
-
|
| 38 |
|
| 39 |
-
|
| 40 |
|
| 41 |
-
|
| 42 |
-
- TRL: 0.24.0
|
| 43 |
-
- Transformers: 4.57.2
|
| 44 |
-
- Pytorch: 2.9.1
|
| 45 |
-
- Datasets: 4.3.0
|
| 46 |
-
- Tokenizers: 0.22.1
|
| 47 |
|
| 48 |
-
##
|
| 49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
|
|
|
|
| 51 |
|
| 52 |
-
Cite TRL as:
|
| 53 |
-
|
| 54 |
```bibtex
|
| 55 |
-
@
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
publisher = {GitHub},
|
| 61 |
-
howpublished = {\url{https://github.com/huggingface/trl}}
|
| 62 |
}
|
| 63 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
license: mit
|
| 3 |
+
base_model: meta-llama/Meta-Llama-3.1-8B-Instruct
|
|
|
|
| 4 |
tags:
|
| 5 |
+
- llama
|
| 6 |
- lora
|
| 7 |
+
- political-science
|
| 8 |
+
- survey-replication
|
| 9 |
+
- canadian-election-study
|
| 10 |
+
- peft
|
| 11 |
- unsloth
|
| 12 |
+
datasets:
|
| 13 |
+
- custom
|
| 14 |
+
language:
|
| 15 |
+
- en
|
| 16 |
pipeline_tag: text-generation
|
| 17 |
---
|
| 18 |
|
| 19 |
+
# CES Phase 3B LoRA: With Party ID
|
| 20 |
|
| 21 |
+
LoRA adapter that includes party identification as an input variable. **For most use cases, prefer [Phase 3A](https://huggingface.co/baglecake/ces-phase3a-lora) instead.**
|
|
|
|
| 22 |
|
| 23 |
+
## Performance
|
| 24 |
|
| 25 |
+
| Model | Variables | r |
|
| 26 |
+
|-------|-----------|---|
|
| 27 |
+
| Phase 3A | Demographics + Leader Ratings + Wedge Issues | 0.560 |
|
| 28 |
+
| **Phase 3B (this model)** | Same + Party ID | **0.574** |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
+
**Partisan Delta = 0.014** (essentially zero)
|
| 31 |
|
| 32 |
+
## Why Phase 3A is Preferred
|
| 33 |
|
| 34 |
+
Adding party ID only improves correlation by 1.4%. This proves party identity is **redundant** — it's already encoded in leader affect and policy positions.
|
| 35 |
|
| 36 |
+
Phase 3B exists for reproducibility and to demonstrate this null result.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
+
## Training Details
|
| 39 |
|
| 40 |
+
- **Base model**: meta-llama/Meta-Llama-3.1-8B-Instruct (4-bit quantized via Unsloth)
|
| 41 |
+
- **Training data**: ~14,455 examples from CES 2021
|
| 42 |
+
- **LoRA rank**: 32
|
| 43 |
+
- **LoRA alpha**: 64
|
| 44 |
+
- **Epochs**: 3
|
| 45 |
|
| 46 |
+
## Citation
|
| 47 |
|
|
|
|
|
|
|
| 48 |
```bibtex
|
| 49 |
+
@software{ces-phase3-lora,
|
| 50 |
+
title = {CES Phase 3 LoRA: Leader Affect and Policy Prediction},
|
| 51 |
+
author = {Coburn, Del},
|
| 52 |
+
year = {2025},
|
| 53 |
+
url = {https://huggingface.co/baglecake/ces-phase3a-lora}
|
|
|
|
|
|
|
| 54 |
}
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
## Part of emile-GCE
|
| 58 |
+
|
| 59 |
+
This model is part of the [emile-GCE](https://github.com/delcoburn/emile-gce) project for Generative Computational Ethnography.
|