Views
No views yet
bert-base-uncased, fine-tuned on transcripts from the
Huth Lab fMRI story-listening dataset for the Stat 214 (Spring 2026)
final project at UC Berkeley.| Hyperparameter | Value |
|---|---|
| Base model | bert-base-uncased |
LoRA rank r | 8 |
| LoRA alpha | 16 |
| LoRA dropout | 0.1 |
| Target modules | query, value |
| Training objective | Masked Language Modeling (MLM, 15%) |
| Training stories | 86 (Huth Lab podcast transcripts) |
| MLM max sequence length | 128 |
| Epochs | 3 |
| Optimizer | AdamW, lr=2e-4 |
| Batch size | 16 |
| Final MLM training loss | — |
| Subject | Mean CC | Top 5% CC | Top 1% CC | Top-1 voxel |
|---|---|---|---|---|
| Subject 2 | 0.0644 | 0.2153 | 0.2918 | 0.4778 |
| Subject 3 | 0.0660 | 0.2184 | 0.3058 | 0.5182 |
1from transformers import BertForMaskedLM, BertTokenizerFast
2from peft import PeftModel
3
4tokenizer = BertTokenizerFast.from_pretrained("bert-base-uncased")
5base = BertForMaskedLM.from_pretrained("bert-base-uncased")
6model = PeftModel.from_pretrained(base, "RheaTinghe/stat214-lab3-bert-lora-r8-maxlen128")
7model.eval()
8
9# Extract per-word embeddings via ±10 word context windows
10# (see scripts/run_bert_pretrained.py in the project repo for the
11# complete extraction pipeline)1@misc{stat214lab3,
2 author = {Galloro, Drew and Wang, Ruihang and Khothsombath, Benjamin and Zhang, Rhea},
3 title = {Stat 214 Lab 3: BERT-LoRA encoding model for fMRI},
4 year = {2026},
5 note = {UC Berkeley Spring 2026},
6}