Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,63 +1,98 @@
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
model_name: ces_phase3a_lora
|
| 5 |
tags:
|
| 6 |
-
-
|
| 7 |
- lora
|
| 8 |
-
-
|
| 9 |
-
-
|
| 10 |
-
-
|
|
|
|
| 11 |
- unsloth
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
| 13 |
pipeline_tag: text-generation
|
| 14 |
---
|
| 15 |
|
| 16 |
-
#
|
| 17 |
|
| 18 |
-
This model
|
| 19 |
-
It has been trained using [TRL](https://github.com/huggingface/trl).
|
| 20 |
|
| 21 |
-
##
|
| 22 |
|
| 23 |
-
|
| 24 |
-
|
|
|
|
|
|
|
| 25 |
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
| 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 3A LoRA: Leader Affect + Policy Positions
|
| 20 |
|
| 21 |
+
This is the **recommended** model for predicting political ideology from demographics, leader thermometers, and wedge issues.
|
|
|
|
| 22 |
|
| 23 |
+
## Performance
|
| 24 |
|
| 25 |
+
| Model | Variables | r |
|
| 26 |
+
|-------|-----------|---|
|
| 27 |
+
| **Phase 3A (this model)** | Demographics + Leader Ratings + Wedge Issues | **0.560** |
|
| 28 |
+
| Phase 3B | Same + Party ID | 0.574 |
|
| 29 |
|
| 30 |
+
**Partisan Delta = 0.014** (essentially zero)
|
| 31 |
+
|
| 32 |
+
## Key Finding: "The Null Result of the Label"
|
| 33 |
+
|
| 34 |
+
Adding party identification provides almost no improvement (+1.4%) over leader affect and policy positions alone.
|
| 35 |
|
| 36 |
+
**What this means:**
|
| 37 |
+
- Party identity is **redundant** — it's already encoded in how people feel about leaders and their policy positions
|
| 38 |
+
- Canadian ideology is **substantive, not tribal** — people's "team" reflects their actual views
|
| 39 |
+
- **Phase 3A is the preferred model** — predicts ideology without "cheating" by asking party affiliation
|
| 40 |
|
| 41 |
+
## Variables
|
| 42 |
|
| 43 |
+
### Demographics
|
| 44 |
+
Age, gender, province, education, employment, religion, marital status, urban/rural, born in Canada
|
| 45 |
|
| 46 |
+
### Leader Thermometers (0-100 ratings)
|
| 47 |
+
- Justin Trudeau
|
| 48 |
+
- Erin O'Toole
|
| 49 |
+
- Jagmeet Singh
|
| 50 |
|
| 51 |
+
### Wedge Issues
|
| 52 |
+
- Carbon tax support
|
| 53 |
+
- Energy sector/pipelines
|
| 54 |
+
- Medical assistance in dying
|
| 55 |
|
| 56 |
+
## Usage
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
|
| 58 |
+
```python
|
| 59 |
+
from peft import PeftModel
|
| 60 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 61 |
+
|
| 62 |
+
base_model = AutoModelForCausalLM.from_pretrained(
|
| 63 |
+
"meta-llama/Meta-Llama-3.1-8B-Instruct",
|
| 64 |
+
load_in_4bit=True
|
| 65 |
+
)
|
| 66 |
+
model = PeftModel.from_pretrained(base_model, "baglecake/ces-phase3a-lora")
|
| 67 |
+
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Meta-Llama-3.1-8B-Instruct")
|
| 68 |
+
```
|
| 69 |
|
| 70 |
+
## Training Details
|
| 71 |
|
| 72 |
+
- **Base model**: meta-llama/Meta-Llama-3.1-8B-Instruct (4-bit quantized via Unsloth)
|
| 73 |
+
- **Training data**: ~14,450 examples from CES 2021
|
| 74 |
+
- **LoRA rank**: 32
|
| 75 |
+
- **LoRA alpha**: 64
|
| 76 |
+
- **Epochs**: 3
|
| 77 |
+
- **Hardware**: NVIDIA A100 40GB (Colab Pro)
|
| 78 |
+
|
| 79 |
+
## Limitations
|
| 80 |
+
|
| 81 |
+
1. **Narrow task**: Model only outputs ideology numbers (0-10).
|
| 82 |
+
2. **Canadian-specific**: Trained on CES 2021 under Trudeau government.
|
| 83 |
+
3. **Leader-specific**: Uses 2021 leader names.
|
| 84 |
+
|
| 85 |
+
## Citation
|
| 86 |
|
|
|
|
|
|
|
| 87 |
```bibtex
|
| 88 |
+
@software{ces-phase3-lora,
|
| 89 |
+
title = {CES Phase 3 LoRA: Leader Affect and Policy Prediction},
|
| 90 |
+
author = {Coburn, Del},
|
| 91 |
+
year = {2025},
|
| 92 |
+
url = {https://huggingface.co/baglecake/ces-phase3a-lora}
|
|
|
|
|
|
|
| 93 |
}
|
| 94 |
+
```
|
| 95 |
+
|
| 96 |
+
## Part of emile-GCE
|
| 97 |
+
|
| 98 |
+
This model is part of the [emile-GCE](https://github.com/delcoburn/emile-gce) project for Generative Computational Ethnography.
|