Matlas: Semantic Math Search Engine
- Matlas is a semantic search engine that uses dependency-aware extraction and dense vector indexing to retrieve fine-grained mathematical statements.
- The system employs a two-stage LLM pipeline to extract and unfold complex dependencies, converting raw LaTeX into self-contained, interpretable snippets.
- Empirical evaluations show that Matlas achieves high precision and low latency, outperforming traditional search tools for theorem-level and paper-level retrieval.
Matlas is a semantic search engine designed for precise retrieval and interpretation of mathematical results, addressing the significant barriers encountered in both human-driven research and AI-assisted mathematical discovery. By combining large-scale extraction of mathematical statements, dependency-aware document modeling, and dense semantic retrieval architectures, Matlas enables users to search for specific theorems, lemmas, corollaries, and definitions at scale across the global mathematical literature. The system has been demonstrated on a corpus comprising over 8 million formal statements from nearly half a million peer-reviewed papers and major textbooks, with methods validated for both mathematician-centric and automated AI-reasoning workflows (Ju et al., 19 Apr 2026, Alexander et al., 5 Feb 2026).
1. Motivation and Background
The expansion of mathematical literature—millions of documents distributed across centuries, journals, and books—creates a formidable obstacle for researchers engaging in theorem discovery, proof verification, or historical tracing. Traditional search tools largely operate at the coarse “paper-level,” failing to retrieve fine-grained mathematical statements due to issues of notation, context-dependence, and the inability to bridge symbolic and natural-language formulations (Ju et al., 19 Apr 2026, Alexander et al., 5 Feb 2026).
Two principal challenges drive the Matlas architecture:
- Scale and Fragmentation: Mathematical results are highly fragmented, often referenced only implicitly, and reliant on prior definitions and statements.
- Contextual Dependency: Isolated theorem statements are typically inextricably tied to local notation and previous results; without explicit unfolding of dependencies, automated retrieval and interpretation are severely hampered.
2. Corpus Construction and Statement Extraction
Matlas constructs a fine-grained corpus suitable for semantic retrieval by systematically extracting mathematical statements and their dependencies from large-scale scientific text (Ju et al., 19 Apr 2026, Alexander et al., 5 Feb 2026). The process encompasses:
- Scoping: 435,000 peer-reviewed papers from 180 citation-selected journals (spanning 1826–2025), complemented by 1,900 textbooks from principal academic publishers.
- Extraction Pipeline: OCR-converted PDF or LaTeX sources are parsed using a two-stage LLM pipeline. First, a “Locator” LLM generates document-specific regular expressions to delineate spans corresponding to theorems, lemmas, definitions, etc. The “Structurer” LLM then segments these spans—within overlapping character windows—into records, each containing:
- A unique identifier,
- Statement type (e.g., Theorem, Lemma, Definition),
- The full LaTeX-style content,
- First-order local dependencies (other statements in the same batch).
- Formal Statement Representation: For document , statements are represented as , with the type, the content, and the set of dependencies.
In the larger Semantic Search pipeline (Alexander et al., 5 Feb 2026), statement environments are parsed from arXiv, Wiki-based math projects, and formal logic textbooks, with explicit tracking of theorem types, user-defined labels, LaTeX bodies, and metadata (authors, titles, categories).
3. Dependency Modeling and Self-Contained Unfolding
To counteract context-dependence, Matlas constructs a directed acyclic dependency graph for each document, with nodes (the statements) and iff depends on (Ju et al., 19 Apr 2026). Unfolding proceeds in topological order:
- Layer Partitioning: Nodes are stratified into layers 0 such that 1 contains all indegree-2 statements and each subsequent layer contains statements whose dependencies have already been assigned to previous layers.
- Recursive Unfolding: The unfolded content 3 for any statement 4 is constructed by concatenating the contents for all dependencies:
5
This produces a self-contained LaTeX snippet for each result, substantially improving interpretability for both human and machine consumers.
4. Semantic Embedding, Indexing, and Retrieval
In both the Matlas corpus and similar large-scale systems, each unfolded statement is encoded as a dense vector using advanced LLM bi-encoders (Qwen3-Embedding-8B; 4096-dimensional) (Ju et al., 19 Apr 2026, Alexander et al., 5 Feb 2026). The retrieval architecture involves:
- LLM-based Sloganization: Raw LaTeX is brittle for embedding models; instead, theorems are “sloganized” by prompting an LLM to produce short, informal, natural-language descriptions that retain theorem essence. Context windows (body only, body plus abstract, or including the first section) are tested, with broader context improving recall (Hit@20 rises from 0.737 to 0.763) (Alexander et al., 5 Feb 2026).
- Dense Vector Indexing: All sloganized statements are embedded and stored in a high-performance vector database (e.g., FAISS, PostgreSQL+pgvector with HNSW and binary quantization). Two-stage retrieval—initial approximate nearest neighbor search followed by exact cosine similarity reranking—enables millisecond-scale query response over 9M+ items.
- Prompting and Query Embedding: Queries are converted into the same embedding space using instruction-tuned prompt prefixes to focus on semantic mathematical content, a strategy that improves P@1 by up to 30% over unprompted embedding (Alexander et al., 5 Feb 2026).
- Optional Cross-Encoder Reranker: Top-6 candidates are reranked using a cross-encoder (Qwen3-Reranker-0.6B), boosting Hit@1 by ≈1.8 percentage points.
The system supports advanced metadata filtering (author, year, category), candidate pruning by context, and periodic re-indexing for corpus updates (Alexander et al., 5 Feb 2026).
5. Evaluation, Baseline Comparison, and Empirical Findings
Evaluations deploy curated search queries from professional mathematicians, each with a unique ground-truth target drawn from a large candidate pool (Alexander et al., 5 Feb 2026):
- Metrics: Precision@k, Hit@k, Mean Reciprocal Rank (MRR).
- Results: The Matlas-style system with Qwen3-8B achieves Theorem-level Hit@20 of 0.450 (compared to 0.198 for ChatGPT 5.2 and 0.270 for Gemini 3 Pro), and Paper-level Hit@20 of 0.568 (versus 0.378 for Google Scholar). Sloganization is found to be essential (Hit@20: 0.306 vs. 0.090 for raw LaTeX).
- Latency and Scalability: 9.2M embeddings occupy ~40GB; a single node can handle ~100 QPS with sub-0.2s latency.
Reported failure modes include returned lemmas from the wrong context and reliance on the LLM license/domain for slogan quality; mitigations involve improved prompting and periodic re-extraction (Alexander et al., 5 Feb 2026).
6. Applications and Broader Impact
Matlas supports a spectrum of advanced mathematical information retrieval tasks (Ju et al., 19 Apr 2026):
- Human Use Cases: Theorem discovery, comparative lemma search, tracing result provenance across historical literature.
- AI Integration: Grounding LLM-based proof assistants, providing self-contained factual statements for automated mathematical reasoning agents. Documented usage includes enabling an autonomous LLM agent to solve an open conjecture by retrieving and instantiating a nontrivial lemma [Ju et al., 2026].
By combining dependency-aware extraction and dense semantic retrieval, Matlas provides machine-readable, self-contained statements suitable for both researchers and downstream AI applications.
7. Limitations and Future Directions
The current implementation exhibits the following constraints (Ju et al., 19 Apr 2026):
- Corpus Coverage: The indexed corpus is limited to selected journals and textbooks, omitting many specialist venues and most arXiv preprints.
- Extraction Noise: OCR artifacts and LLM segmentation errors can impede accurate boundary detection and dependency resolution.
- Dependency Depth: Only immediate dependencies are inlined; high-level mathematical context may remain unrepresented for deeply nested results.
- Absence of Standardized Formal Evaluation: There is no established benchmark suite for theorem-level semantic search; current results are based on blind-query curation.
Ongoing and proposed enhancements include:
- Expansion to arXiv and broader sources to close coverage gaps.
- Methodological improvements in multi-hop dependency detection and graph-based reasoning.
- Integration of formal verification systems for rigorous cross-confirmation of extracted statements.
- Development of benchmark datasets annotated with ground-truth relevance to support systematic evaluation (precision, recall, MRR).
Improvements in semantic search for mathematical statements are expected to generalize to other domains with fine-grained, context-sensitive scientific content (Latard et al., 2017, Patel, 2019). In broader contexts, analogous pipelines—combining symbolic extraction, dependency modeling, sloganization, and dense retrieval—are directly transferable to semantic search problems in scientific and technical literature (Yang et al., 2023, Rygl et al., 2017).