baglecake commited on
Commit
a80d8a1
·
verified ·
1 Parent(s): 78f0200

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +75 -40
README.md CHANGED
@@ -1,63 +1,98 @@
1
  ---
2
- base_model: unsloth/meta-llama-3.1-8b-instruct-bnb-4bit
3
- library_name: peft
4
- model_name: ces_phase3a_lora
5
  tags:
6
- - base_model:adapter:unsloth/meta-llama-3.1-8b-instruct-bnb-4bit
7
  - lora
8
- - sft
9
- - transformers
10
- - trl
 
11
  - unsloth
12
- licence: license
 
 
 
13
  pipeline_tag: text-generation
14
  ---
15
 
16
- # Model Card for ces_phase3a_lora
17
 
18
- This model is a fine-tuned version of [unsloth/meta-llama-3.1-8b-instruct-bnb-4bit](https://huggingface.co/unsloth/meta-llama-3.1-8b-instruct-bnb-4bit).
19
- It has been trained using [TRL](https://github.com/huggingface/trl).
20
 
21
- ## Quick start
22
 
23
- ```python
24
- from transformers import pipeline
 
 
25
 
26
- question = "If you had a time machine, but could only go to the past or the future once and never return, which would you choose and why?"
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
- This model was trained with SFT.
 
 
 
38
 
39
- ### Framework versions
 
 
 
40
 
41
- - PEFT 0.18.0
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
- ## Citations
 
 
 
 
 
 
 
 
 
 
49
 
 
50
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
 
52
- Cite TRL as:
53
-
54
  ```bibtex
55
- @misc{vonwerra2022trl,
56
- title = {{TRL: Transformer Reinforcement Learning}},
57
- author = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallou{\'e}dec},
58
- year = 2020,
59
- journal = {GitHub repository},
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.