TL;DR: Our interactions with large language models (LLMs) are dominated by task- or topic-specific questions, such as “solve this coding problem” or “what is democracy?” This framing strongly shapes how LLMs generate responses, constraining the range of behaviors and knowledge that can be observed. We study the behavior of LLMs using minimal, topic-neutral prompts. Despite the absence of explicit task or topic specification, LLMs generate diverse content; however, each model family exhibits strong and systematic topical preferences. GPT-OSS favors programming and math, Llama leans literary, DeepSeek often produces religious content, and Qwen tends toward multiple-choice questions. We further observe that our generation settings can degenerate into repetitive or meaningless outputs, revealing model-specific quirks, such as Llama generating personal social media URLs.
Figure 1. UMAP visualzation generated by frontier LLMs when prompted with minimal seed phrases. We observe significant variation in topic preferences across model families, revealing distinct conceptual priors embedded during training. A high-quality image is provided in the paper.
This codebase provides tools for:
- Text Generation: Generate completions from LLMs using various starter phrases (chain-of-thought, rhetorical inquiry, conversational softeners, etc.)
- Data Cleaning: Remove repetitive patterns that can occur in unconstrained generation
- Embedding Extraction: Extract semantic embeddings for downstream analysis
- Semantic Labeling: Classify generated text into hierarchical topic categories
- Difficulty Labeling: Assess the complexity level of math and programming content
llm_tom_analysis/
├── configs/
│ └── text_completion.yaml # Configuration for models and sampling
├── prompts/ # Prompt templates for labeling tasks
│ ├── math_difficulty_prompt.txt
│ ├── programming_difficulty_prompt.txt
│ └── semantic_labeling_prompt.txt
├── src/
│ ├── generate_text_completion.py # Main entry point for text generation
│ ├── generate_utils.py # Generator class (LiteLLM/vLLM backends)
│ ├── clean_data.py # Remove repetitive patterns from outputs
│ ├── extract_embedding.py # Extract embeddings using Qwen3-Embedding
│ ├── semantic_labeling.py # Open-vocabulary semantic classification
│ ├── level_test_labeling.py # Difficulty labeling (basic→expert)
│ └── utils.py # Utility functions
├── data/ # Data directory (not included in repo)
└── outputs/ # Generated outputs directory
# Install dependencies
pip install vllm litellm pydantic tenacity pandas torch tqdm
# Set API key for API-based inference (optional)
export TOGETHER_API_KEY="your-api-key"- Python 3.10+
- vLLM (for local inference and embeddings)
- LiteLLM (for API-based inference)
- PyTorch
- pandas, pydantic, tenacity
Generate text completions from LLMs using various starter phrases:
# Using API-based inference (LiteLLM)
python -m src.generate_text_completion \
--config configs/text_completion.yaml \
--model_key qwen2.5 \
--backend litellm
# Using local GPU inference (vLLM)
python -m src.generate_text_completion \
--config configs/text_completion.yaml \
--model_key llama3.1 \
--backend vllmRemove repetitive patterns from generated outputs:
python -m src.clean_data \
--raw-dir data/raw/model_outputs \
--clean-dir data/clean/model_outputsExtract semantic embeddings for analysis:
python -m src.extract_embedding \
--model_outputs_dir data/clean/model_outputs \
--embedding_dir data/embeddingsClassify generated text into semantic categories:
python -m src.semantic_labeling \
--clean-dir data/clean/model_outputs \
--label-dir data/semantic_labels/model_outputsLabel math and programming content by difficulty level:
python -m src.level_test_labeling \
--input-file data/level_test/level_test_subset.csv \
--model openai/gpt-oss-120bEdit configs/text_completion.yaml to configure:
- Models: Available LLMs for both API and local inference
- Sampling parameters: temperature, top_p, max_tokens, batch_size
- Starter phrases: Various prompt categories for probing LLM priors
- Output paths: Where to save generated sequences
This project is released for research purposes. Please cite our work if you use this codebase.