Datasets:
hidden_vector listlengths 2.3k 2.3k | cefr_level stringclasses 10
values |
|---|---|
[
-2.1217949390411377,
0.08483573794364929,
-3.5801281929016113,
1.6650640964508057,
-1.365384578704834,
0.5773237347602844,
-1.6410256624221802,
-0.030073117464780807,
0.6254006624221802,
-1.4246795177459717,
-1.3830127716064453,
0.6722756624221802,
0.6021634340286255,
-0.7191506624221802,
... | B2 |
[
2.2109375,
2.3893229961395264,
-2.6197917461395264,
2.3893229961395264,
-0.921875,
1.5052083730697632,
-4.2578125,
1.1341146230697632,
-0.8131510615348816,
1.4661458730697632,
-2.14453125,
0.8111979365348816,
-0.9830729365348816,
-2.7630207538604736,
2.1549479961395264,
-2.397135496139... | B1 |
[
-0.6706730723381042,
-2.054086446762085,
-2.227163553237915,
0.9044471383094788,
0.22445914149284363,
-1.592548131942749,
-3.132211446762085,
-0.5315504670143127,
0.8786057829856873,
1.0072115659713745,
-1.5276442766189575,
-0.5099158883094788,
2.225961446762085,
-1.5432692766189575,
1.4... | B1 |
[
0.15803328156471252,
1.6820652484893799,
0.17255434393882751,
0.017344599589705467,
-0.788722813129425,
2.2418477535247803,
-1.75,
1.3301630020141602,
0.126953125,
-1.77853262424469,
1.0366847515106201,
-0.23556385934352875,
-0.21688179671764374,
-2.6046195030212402,
3.45652174949646,
... | B2 |
[-1.3251953125,1.822265625,-3.00390625,0.95751953125,-0.94873046875,0.939453125,-1.833984375,0.38696(...TRUNCATED) | A2 |
[-0.001220703125,0.5455729365348816,-1.2309027910232544,0.4500868022441864,-1.4600694179534912,3.071(...TRUNCATED) | A2 |
[1.2922793626785278,0.9724264740943909,-1.9227941036224365,3.1875,-1.1654411554336548,1.206801414489(...TRUNCATED) | A2 |
[0.72265625,0.8297991156578064,-2.7098214626312256,-0.6925223469734192,-0.56640625,0.963169634342193(...TRUNCATED) | B1 |
[-1.2291666269302368,-0.113746277987957,-3.372023820877075,1.8973214626312256,-0.277529776096344,0.3(...TRUNCATED) | B2 |
[0.7473958134651184,1.421875,-1.959375023841858,1.2854167222976685,-3.695833444595337,0.283593744039(...TRUNCATED) | B2 |
CEFR Gemma Hidden States Combined Dataset
Overview
This dataset contains high-fidelity 1D latent representations extracted from the frozen google/gemma-2-2b transformer architecture. It maps 13,500 English sentences across the 6 discrete Common European Framework of Reference for Languages (CEFR) proficiency bands ($A1 \rightarrow C2$).
This resource was engineered explicitly to support Phase 1 of a Plug and Play Language Model (PPLM) architecture, allowing researchers to train downstream lightweight linear steering classifiers without hosting heavy multi-billion-parameter language assets in active GPU memory across multiple training epochs.
Source Data Configuration
To maximize stylistic variance, eliminate high-dimensional feature starvation, and build robust linguistic classification boundaries, this corpus integrates and homogenizes four distinct open-source CEFR streams:
UniversalCEFR/readme_en: Clean pedagogical prose, textbook layouts, and structured reading comprehension text.UniversalCEFR/cefr_sp_en: A massive library (~10k rows) of short, authentic, everyday conversational sentences providing raw syntactic volume.UniversalCEFR/cefr_asag_en: Automated Short Answer Grading text featuring actual non-native student responses, capturing structural learner errors.UniversalCEFR/elg_cefr_en: Formal European Language Grid documentation capturing highly advanced B2/C1 bureaucratic configurations.
Dataset Structure
The dataset contains a single train split consisting of two core features:
| Column Name | Data Type | Description |
|---|---|---|
hidden_vector |
Sequence(float32) |
A 1D vector of size 2,304 generated via attention-aware mean pooling on Layer 26 activations. |
cefr_level |
String |
The target categorical proficiency label (A1, A2, B1, B2, C1, C2, including normalized + tags). |
Class Distribution (Bell Curve Layout)
The combined corpus naturally follows a Gaussian distribution profile:
- A1: 2.5%
- A2: 15.3%
- B1: 30.3%
- B2: 32.1%
- C1: 16.2%
- C2: 2.7%
Note for downstream training: Due to the inherent data sparsity at the margins (A1 and C2), it is highly recommended to enforce Class-Weighted Cross-Entropy loss functions or strategic data oversampling during classifier training loops.
Feature Extraction Methodology
The arrays were computed using a deterministic parallel prefill processing configuration:
- Model Baseline:
google/gemma-2-2bprocessed text inputs using a squared parallel sequence batch size of 16 under stricttorch.no_grad()constraints. - Attention-Aware Pooling: Latent representations ($H_t$) were intercepted right out of Layer 26. An explicit attention mask was applied element-wise to discard
<pad>tensor artifacts, taking the mathematical mean strictly across valid token contexts to avoid feature corruption. - Sanitation: All floating-point metrics were scrubbed using
torch.nan_to_numto anchor out-of-bounds $FP16$ inference overflows into safe, uniform parameters. - Randomization: The entire combined layout was fully scrambled via a global shuffle (
seed=42) to guarantee homogeneous distribution for subsequent batch optimizers.
Usage & Intended Applications
This dataset is optimized for training a standalone, single-layer linear classification matrix to act as a PPLM steering head.
from datasets import load_dataset
import torch
# Download the representations
dataset = load_dataset("MohammadKhosravi/cefr-gemma-hidden-states-combined", split="train")
# Extract sample vector
sample_vector = torch.tensor(dataset[0]["hidden_vector"])
print("Vector size:", sample_vector.shape) # Output: torch.Size([2304])
- Downloads last month
- 19