CIF3 is a framework and implementation for explicit context isolation in language model embeddings. It is designed to study the challenge of context leakage in large language models (LLMs) by enforcing clear boundaries between different contexts within the embedding space. This repository contains the code, experiments, and evaluation metrics for CIF3.
cif3.py — Core CIF3 architecture, metrics, and visualization tools.CIF_usingllmembeddings.py — CIF implementation with LLM embeddings and hybrid boundary score.test_cif3.py — Main experimental pipeline, dataset loaders, and statistical evaluation.CIF_onlargedata.py — CIF for large-scale data scenarios(experimental).CIF_Vs_baseline.py — Baseline comparison and visualization(experimental).requirements.txt — Python dependencies.pip install -r requirements.txt
python test_cif3.py --dataset newsgroups --n_trials 5
You can also use BBC News, CSV, or custom text datasets (see code for options).For questions or issues, please open a GitHub issue or contact the author.
This code is released under [License Name] for academic research only. See the LICENSE file for details.
Python
100.0%
CIF3 is a framework and implementation for explicit context isolation in language model embeddings. It is designed to study the challenge of context leakage in large language models (LLMs) by enforcing clear boundaries between different contexts within the embedding space. This repository contains the code, experiments, and evaluation metrics for CIF3.
cif3.py — Core CIF3 architecture, metrics, and visualization tools.CIF_usingllmembeddings.py — CIF implementation with LLM embeddings and hybrid boundary score.test_cif3.py — Main experimental pipeline, dataset loaders, and statistical evaluation.CIF_onlargedata.py — CIF for large-scale data scenarios(experimental).CIF_Vs_baseline.py — Baseline comparison and visualization(experimental).requirements.txt — Python dependencies.pip install -r requirements.txt
python test_cif3.py --dataset newsgroups --n_trials 5
You can also use BBC News, CSV, or custom text datasets (see code for options).For questions or issues, please open a GitHub issue or contact the author.
This code is released under [License Name] for academic research only. See the LICENSE file for details.
Python
100.0%