Dataset Viewer
Auto-converted to Parquet Duplicate
hidden_vector
listlengths
4.1k
4.1k
cefr_level
stringclasses
10 values
[ -0.7007812261581421, -0.17607422173023224, -0.11249999701976776, -0.3564453125, -0.24589844048023224, -0.0947265625, 0.19482421875, -0.008532715030014515, 0.10468749701976776, 0.20078125596046448, -0.25390625, -0.11308594048023224, -0.2607421875, 0.61328125, 0.5855468511581421, -0.0281...
B2
[ -0.267578125, -0.1619466096162796, -0.2190755158662796, 0.0388387031853199, -0.5472005009651184, 0.1365559846162796, 0.126220703125, 0.1796875, 0.3382161557674408, 0.3486328125, -0.1975911408662796, 0.13623046875, -0.3151041567325592, -0.0835774764418602, 0.1223958358168602, 0.39518228...
B1
[-0.2679332494735718,-0.4019886255264282,-0.33913353085517883,-0.11070667952299118,-0.25870028138160(...TRUNCATED)
B1
[-0.18310546875,-0.5,-0.4654947817325592,-0.306640625,0.01312255859375,-0.17529296875,-0.09513346105(...TRUNCATED)
B2
[-0.501953125,-0.34228515625,-0.1434326171875,0.033966064453125,-0.03582763671875,0.302734375,-0.370(...TRUNCATED)
A2
[-0.50390625,-0.5130208134651184,-0.58203125,-0.2556423544883728,-0.1528862863779068,0.2393663227558(...TRUNCATED)
A2
[-0.2509014308452606,-0.8335336446762085,0.09698016941547394,-0.09397535771131516,0.1365685164928436(...TRUNCATED)
A2
[-0.3893229067325592,0.06210937350988388,-0.2893229126930237,0.02071940153837204,0.12057291716337204(...TRUNCATED)
B1
[0.1203497052192688,-0.5680803656578064,-0.367373526096344,0.1016555055975914,0.148530513048172,0.12(...TRUNCATED)
B2
[-0.5911458134651184,-0.784375011920929,0.21380208432674408,-0.4088541567325592,-0.5395833253860474,(...TRUNCATED)
B2
End of preview. Expand in Data Studio

CEFR Llama Hidden States Combined Dataset

Overview

This dataset contains high-fidelity 1D latent representations extracted from the frozen meta-llama/Llama-3.1-8B-Instruct transformer architecture. It maps 13,837 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:

  1. UniversalCEFR/readme_en: Clean pedagogical prose, textbook layouts, and structured reading comprehension text.
  2. UniversalCEFR/cefr_sp_en: A massive library of short, authentic, everyday conversational sentences providing raw syntactic volume.
  3. UniversalCEFR/cefr_asag_en: Automated Short Answer Grading text featuring actual non-native student responses, capturing structural learner errors.
  4. 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(float64) A 1D vector of size 4,096 generated via attention-aware mean pooling on Layer 31 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:

  1. Model Baseline: meta-llama/Llama-3.1-8B-Instruct processed text inputs using a squared parallel sequence batch size under strict torch.no_grad() constraints.
  2. Attention-Aware Pooling: Latent representations ($H_t$) were intercepted right out of Layer 31 (the penultimate layer). 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.
  3. Sanitation: All floating-point metrics were scrubbed using torch.nan_to_num to anchor out-of-bounds inference overflows into safe, uniform parameters.
  4. 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-llama3.1-8b-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([4096])
Downloads last month
15

Models trained or fine-tuned on MohammadKhosravi/cefr-llama3.1-8b-hidden-states-combined