llm_verlan is a small research repository for studying how French language models handle verlan and other informal French variants.
The repository currently contains two main experiment tracks:
camembert-base.lang_informal/ for comparing standard and informal variants with masked or causal language models.This is a research codebase, not a packaged library. The emphasis is on transparent experiments, small curated datasets, and reproducible outputs.
The central question is whether French models process verlan differently from standard forms at multiple levels:
The main pipeline lives in src/ and scripts/.
It:
By default, the pipeline uses camembert-base.
The lang_informal/ directory contains a broader sentence-pair setup for standard versus informal French.
It includes:
The repository also includes notebooks for exploratory work on:
These notebooks complement the scripted pipeline but are not required for the core experiments.
llm_verlan/
├── README.md
├── requirements.txt
├── artifacts/
│ ├── cache/
│ ├── figures/
│ └── models/
├── data/
│ ├── raw/
│ ├── interim/
│ └── processed/
│ ├── verlan_base_forms.csv
│ ├── verlan_database.csv
│ ├── verlan_experiment_core.csv
│ ├── verlan_experiment_selected.csv
│ ├── verlan_freq.csv
│ ├── verlan_probe_pairs.csv
│ ├── verlan_probe_templates.csv
│ └── wiktionary_verlan_titles.csv
├── lang_informal/
│ ├── data/
│ ├── notebook/
│ └── scripts/
├── notebooks/
├── outputs/
├── results/
├── scripts/
└── src/
Create a virtual environment and install the minimal dependencies:
pip install -r requirements.txt
The current requirements.txt includes:
pandasmatplotlibsentencepiecetorchtransformersWhen you run the model-based scripts for the first time, the selected checkpoint will be downloaded from Hugging Face.
Run all commands from the repository root:
cd llm_verlan
python scripts/run_verlan_probe.py
This script uses:
data/processed/verlan_probe_pairs.csvdata/processed/verlan_probe_templates.csvand writes results to:
outputs/verlan_probe/experiment_results.csvoutputs/verlan_probe/tokenization_results.csvoutputs/verlan_probe/failures.csvoutputs/verlan_probe/run_metadata.jsonKey metrics include:
self, intra-word, and contextUseful options:
python scripts/run_verlan_probe.py --model-name camembert-base --limit-pairs 5
python scripts/run_verlan_probe.py --device cpu
python scripts/plot_verlan_probe.py
This reads the CSV outputs above and writes summary figures to outputs/verlan_probe/figures/.
The plotting script also creates a subword fragmentation summary table comparing average subword counts for verlan and standard forms.
python lang_informal/scripts/build_balanced_dataset.py \
--output-csv lang_informal/data/paired_informal_french_dataset.csv
The generated dataset contains 350 rows: 50 examples for each of seven groups:
verlansmsspokenverlan_smsverlan_spokensms_spokenverlan_sms_spokenpython lang_informal/scripts/camembert_analysis.py \
--input-csv lang_informal/data/paired_informal_french_dataset.csv \
--output-csv lang_informal/data/paired_informal_french_dataset_camembert_analysis.csv \
--model-name camembert-base
This script:
Built-in model aliases include:
camembertcamembert-basecamembert_v2clair-7b-0.1The small probe set currently includes:
data/processed/verlan_probe_pairs.csv: 5 verlan/standard pairsdata/processed/verlan_probe_templates.csv: 12 sentence templates grouped by part-of-speech-like usageThese files are used directly by the scripted probing pipeline.
The data/processed/ directory also includes supporting lexical tables such as:
verlan_database.csvverlan_base_forms.csvwiktionary_verlan_titles.csvverlan_freq.csvThese are useful for extending the probe set or building future experiments.
Under lang_informal/data/, the repository contains paired datasets for standard and informal French, including a second version with richer metadata and precomputed analysis outputs.
The repository already includes example outputs from previous runs, including:
outputs/verlan_probe/experiment_results.csvoutputs/verlan_probe/tokenization_results.csvoutputs/verlan_probe/run_metadata.jsonoutputs/openai_pairwise_results.csvoutputs/openai_retrieval_results.csvresults/verlan_frequency_full.csvThese files are useful as references, but you should regenerate results for any formal comparison or reporting.
src/load_model.py: model loading and device selectionsrc/token_utils.py: tokenization and target-span alignmentsrc/attention_analysis.py: attention aggregation metricssrc/hidden_analysis.py: hidden-state pooling and cosine similaritysrc/run_experiment.py: end-to-end probe executionsrc/plot_results.py: summary plottingFor each target span, the probe script aggregates outgoing attention into:
self: a target subword attending to itselfintra: attention from one target subword to another subword of the same targetcontext: attention from the target span to the rest of the sentenceIt also computes incoming attention from the rest of the sentence into the target span.
Sentence representations are obtained by mean-pooling hidden states while excluding special tokens when possible. Word representations are obtained by mean-pooling the hidden states over the target token span.
data/raw/ and are intentionally excluded from Git.artifacts/models/ and artifacts/cache/.Natural next steps for this repository include:
No explicit license file is currently included in the repository. If you plan to reuse or publish this code, add a license and cite the data sources and model checkpoints used in your experiments.
llm_verlan is a small research repository for studying how French language models handle verlan and other informal French variants.
The repository currently contains two main experiment tracks:
camembert-base.lang_informal/ for comparing standard and informal variants with masked or causal language models.This is a research codebase, not a packaged library. The emphasis is on transparent experiments, small curated datasets, and reproducible outputs.
The central question is whether French models process verlan differently from standard forms at multiple levels:
The main pipeline lives in src/ and scripts/.
It:
By default, the pipeline uses camembert-base.
The lang_informal/ directory contains a broader sentence-pair setup for standard versus informal French.
It includes:
The repository also includes notebooks for exploratory work on:
These notebooks complement the scripted pipeline but are not required for the core experiments.
llm_verlan/
├── README.md
├── requirements.txt
├── artifacts/
│ ├── cache/
│ ├── figures/
│ └── models/
├── data/
│ ├── raw/
│ ├── interim/
│ └── processed/
│ ├── verlan_base_forms.csv
│ ├── verlan_database.csv
│ ├── verlan_experiment_core.csv
│ ├── verlan_experiment_selected.csv
│ ├── verlan_freq.csv
│ ├── verlan_probe_pairs.csv
│ ├── verlan_probe_templates.csv
│ └── wiktionary_verlan_titles.csv
├── lang_informal/
│ ├── data/
│ ├── notebook/
│ └── scripts/
├── notebooks/
├── outputs/
├── results/
├── scripts/
└── src/
Create a virtual environment and install the minimal dependencies:
pip install -r requirements.txt
The current requirements.txt includes:
pandasmatplotlibsentencepiecetorchtransformersWhen you run the model-based scripts for the first time, the selected checkpoint will be downloaded from Hugging Face.
Run all commands from the repository root:
cd llm_verlan
python scripts/run_verlan_probe.py
This script uses:
data/processed/verlan_probe_pairs.csvdata/processed/verlan_probe_templates.csvand writes results to:
outputs/verlan_probe/experiment_results.csvoutputs/verlan_probe/tokenization_results.csvoutputs/verlan_probe/failures.csvoutputs/verlan_probe/run_metadata.jsonKey metrics include:
self, intra-word, and contextUseful options:
python scripts/run_verlan_probe.py --model-name camembert-base --limit-pairs 5
python scripts/run_verlan_probe.py --device cpu
python scripts/plot_verlan_probe.py
This reads the CSV outputs above and writes summary figures to outputs/verlan_probe/figures/.
The plotting script also creates a subword fragmentation summary table comparing average subword counts for verlan and standard forms.
python lang_informal/scripts/build_balanced_dataset.py \
--output-csv lang_informal/data/paired_informal_french_dataset.csv
The generated dataset contains 350 rows: 50 examples for each of seven groups:
verlansmsspokenverlan_smsverlan_spokensms_spokenverlan_sms_spokenpython lang_informal/scripts/camembert_analysis.py \
--input-csv lang_informal/data/paired_informal_french_dataset.csv \
--output-csv lang_informal/data/paired_informal_french_dataset_camembert_analysis.csv \
--model-name camembert-base
This script:
Built-in model aliases include:
camembertcamembert-basecamembert_v2clair-7b-0.1The small probe set currently includes:
data/processed/verlan_probe_pairs.csv: 5 verlan/standard pairsdata/processed/verlan_probe_templates.csv: 12 sentence templates grouped by part-of-speech-like usageThese files are used directly by the scripted probing pipeline.
The data/processed/ directory also includes supporting lexical tables such as:
verlan_database.csvverlan_base_forms.csvwiktionary_verlan_titles.csvverlan_freq.csvThese are useful for extending the probe set or building future experiments.
Under lang_informal/data/, the repository contains paired datasets for standard and informal French, including a second version with richer metadata and precomputed analysis outputs.
The repository already includes example outputs from previous runs, including:
outputs/verlan_probe/experiment_results.csvoutputs/verlan_probe/tokenization_results.csvoutputs/verlan_probe/run_metadata.jsonoutputs/openai_pairwise_results.csvoutputs/openai_retrieval_results.csvresults/verlan_frequency_full.csvThese files are useful as references, but you should regenerate results for any formal comparison or reporting.
src/load_model.py: model loading and device selectionsrc/token_utils.py: tokenization and target-span alignmentsrc/attention_analysis.py: attention aggregation metricssrc/hidden_analysis.py: hidden-state pooling and cosine similaritysrc/run_experiment.py: end-to-end probe executionsrc/plot_results.py: summary plottingFor each target span, the probe script aggregates outgoing attention into:
self: a target subword attending to itselfintra: attention from one target subword to another subword of the same targetcontext: attention from the target span to the rest of the sentenceIt also computes incoming attention from the rest of the sentence into the target span.
Sentence representations are obtained by mean-pooling hidden states while excluding special tokens when possible. Word representations are obtained by mean-pooling the hidden states over the target token span.
data/raw/ and are intentionally excluded from Git.artifacts/models/ and artifacts/cache/.Natural next steps for this repository include:
No explicit license file is currently included in the repository. If you plan to reuse or publish this code, add a license and cite the data sources and model checkpoints used in your experiments.