Anonymized1/Interacting-With-LLMs
PRISE — Privacy Risk Inference System with Explainability
PRISE is a browser-based chat interface that places a transparency layer between the user and a conversational LLM. Alongside the model's ordinary reply, each turn is annotated to show what the system has learned about the user. Identifying details in the message are highlighted and labelled by type. Phrases that match an external record about the user are marked and traced back to their source. A profile card lists the demographic attributes the model can now predict, each with its confidence and the evidence behind it. A single risk score summarises the turn.
Differential privacy can be applied on the user's side: before a message is sent, its content words are perturbed so that the model receives a noised version of the text. The conversation panel still shows what the user actually wrote, and a badge on the message reports how many words were substituted and at which privacy budget (ε).
Usage
Dependencies
Python 3.10. Install with:
pip install -r requirements.txtThe main dependencies are Gradio, OpenAI, LangChain, FAISS, sentence-transformers and rank-bm25.
API keys
Keys are read from the environment; only the provider you intend to use is required.
export GEMINI_API_KEY="..." # default provider
export OPENAI_API_KEY="..." # optional
export TOGETHER_API_KEY="..." # optional
export VALID_ACCESS_TOKEN_1="..." # optional, gates the app behind a tokenRunning
python app.pyThe app serves on http://localhost:7860.
Options
Every option below is available both as a command-line flag and as a URL query parameter, so a configuration can be assigned via a link:
http://localhost:7860/?rag=1&epsilon=20&show_pii_highlights=1token is accepted as a URL parameter only, and carries the session access token. --retriever_path (an alternative retriever pickle) and --port (default 7860) are command-line flags only.
License
CC BY 4.0.
