Exegetical Edges: Modeling Quranic Intratextuality through Scholars & Statistics
Exploring structural and statistical patterns in large networks of Quranic intratextual connections across 30+ exegeses.
Search for intratextual connections within the Quran
Example Input: The Heifer (2:130)
وَمَن يَرْغَبُ عَن مِّلَّةِ إِبْرَٰهِـۧمَ إِلَّا مَن سَفِهَ نَفْسَهُۥ ۚ وَلَقَدِ ٱصْطَفَيْنَـٰهُ فِى ٱلدُّنْيَا ۖ وَإِنَّهُۥ فِى ٱلْـَٔاخِرَةِ لَمِنَ ٱلصَّـٰلِحِينَ
Who but a fool would forsake the religion of Abraham? We have chosen him in this world and he will rank among the righteous in the Hereafter.
Intratextual Connection Results
This project utilizes data science and network analysis to examine the practice of tafsir al-Qur’an bi-l-Qur’an (explaining the Quran through the Quran) via a ‘distant reading’ approach. By aggregating over ~100K scholarly citation links across 30+ classical and modern exegetical works, this work creates a statistical model that maps intratextual relationships between verses. This approach allows for a bird’s-eye view of how exegetes agree, diverge, or identify idiosyncratic connections, ultimately providing a tool to discover patterns and potentially novel links that traditional, manual analysis might overlook.
Data Aggregation: Compiled a massive dataset of over 100K citation links from more than 30 tafsir works.
Modeling Intratextuality: Developed a machine learning model that generates “embeddings” (numeric fingerprints) for Quranic study units based on morphological data, literal translations, and exegetical commentary to predict and score intratextual relatedness between any 2 verses.
Search and Visualization: Built an interactive web application featuring ranked semantic search, 2D landscape mapping of verse clusters, and filters to compare statistical similarity against historical citation frequency.
Structural Analytics: Performed multi-level statistical analysis to quantify consensus, divergence, and “distinctiveness” at the levels of verse-pairs, individual verses, specific scholars, and thematic communities.
Methodological Framework: Established a scalable, data-driven approach to exegetical research that highlights gaps between historical scholarly tradition and computational similarity metrics.
This project introduces a computational framework that maps the complex landscape of Quranic intratextuality, potentially offering scholars and students alike a new, scalable way to analyze historical exegetical trends and uncover previously unexamined connections between verses.
Table of Contents
Motivation: The inspiration behind the project and the goal of moving from manual cataloging to scalable data science.
The Data: An overview of the 100K citation links pooled from over 30 major exegetical works.
Technical Overview: How the project turns Quranic verses into study units and uses machine learning embeddings to learn patterns of relatedness.
Features, Analytics, & Visualization: A breakdown of the web-based tools, including semantic search, the Explore Map, and citation plotting.
Structural Analysis: Insights into how scholars align—or diverge—at the level of verse pairs, individual exegetes, and thematic communities.
Limitations & Future Extensions: Reflections on the current methodology and ideas for future development, including domain expert verification.
1. Motivation
Dr. Sohaib Saeed Bhutta (SOAS, University of London) did something wonderfully patient: he took one whole chapter, Surah al-An’am (165 verses), and manually catalogued every time a major exegete pointed from one verse to another elsewhere in the text (the practice known as tafsir al-Qur’an bi-l-Qur’an, “explaining the Quran through the Quran”). He did this across roughly eight major works, from the earliest complete commentary on record to modern ones, including scholars from different eras, schools of thought, and even different sects.
So, natural extension from a data science perspective: how can we automate and visualize such a procedure?
Intuitively, we can imagine that intratextual connection could be ‘predicted’ if we had the right signals between any 2 verses:
morphological data for each word in the verse (Quran Corpus data)
overall literal meaning(s) of a verse (proxied by translation text)
expanded commentary from experts about a verse (exegesis text)
Gathering this data and combining it with scholarly citations of intratextual connections, we could technically build a model that could ‘score’ the intratextual connection between any 2 verses. This “score” would be interpreted as:
Score = How statistically similar is the morphology, translation, and commentary of this pair compared to the morphology, translation, and commentary of existing scholarly cited pairs?
Dr. Saeed’s finding was that the overlap between these scholars’ chosen connections was surprisingly low — even between works you’d expect to line up closely because one scholar studied under, or was clearly influenced by, another. Two people looking at the exact same verse, both trained in the same tradition, would often point to entirely different “parallel” verses elsewhere in the text.
This project looks at the statistical results if we pool many of the exegesis connections together, and then try to discover the pattern behind their choices.
From there, we can compare citations in a variety of ways, measuring agreement, disagreement, statistical anomalies, connection strengths, gap analysis, etc. and even uncover potentially novel connections not seen in the dataset.
2. The data: exegesis citations, pooled across 30+ works
A “citation” here means something concrete: while writing about verse A, a classical scholar explicitly points to verse B — quoting it, referencing it in brackets, or explaining A by way of B. Do it for 30+ different tafsir works and you get something closer to a pooled, cross-checked map: 6,236 verses of the Quran, and roughly ~100K (unique) citation links between them, each one tagged with exactly which scholars made it.
Artifact (A): A dataset containing ~100K citation links between verses in the quran, across 30+ exegetes.
3. Technical Overview
*Skip this if you don’t care about the algorithmic details
Before any modeling happens, verses that are almost always discussed together and read near-identically in most commentaries get merged into single “study units”. We turn the 6,236 raw verses into about ~2K units that better match how the text is actually studied.
The core idea: learn from what’s known to find patterns
Instead of treating the citation data we extracted as a fixed list to look up, the project uses it as training signal for a small model. The idea, in plain terms:
Take pairs of verses that scholars did explicitly connect. Call these “yes” examples.
Take pairs of verses picked at random (with some care to avoid trivial cases, like verses that are simply next to each other). Call these “no” examples.
Show the model many of both, alongside three views of each verse — its Arabic root patterns, the language of its surrounding commentary, and its translated meaning — and have it learn to tell the “yes” pairs apart from the “no” pairs.
Do this enough times, over enough examples, and the model isn’t just memorizing “verse X and verse Y were cited together.” It’s picking up on the shape of what tends to make two verses feel connected — shared vocabulary, shared imagery, shared argument — well enough to make a judgment call about a pair of verses that, perhaps, no scholar in the dataset ever explicitly linked.
Ultimately, this model then gives us an ‘embedding’ for each quranic unit. We can then use this embedding to do a bunch of things very easily like finding ‘the top 10 closest units to this unit’, etc.
Quick technical detour - What is an embedding exactly? Since the word comes up a lot in this kind of work: an “embedding” is just a way of turning something — a verse, in this case — into a short list of numbers, chosen so that two things which are alike end up with similar-looking lists, and two things which are unalike end up with very different-looking lists. Once that’s done, “how related are these two verses?” becomes a fairly simple math question: how close are their two lists of numbers?
Once every verse (or merged study unit) across the whole Quran has one of these numeric fingerprints, comparing any two of them at scale gives an estimate of citation-style relatedness for the entire text at once.
The rest of the work goes towards visualizing, tooling, and surfacing these connections and research. This research now sits underneath a small, living search tool for exploring those connections. The tool has its own guided tour on the web app through which you can learn how to use it.
4. Features, Analytics, & Visualization
For the purposes of this section, some vocabulary to understand:
a unit = a set of consecutive verses
a unit-‘pair’ = represents 2 units being compared with one another for their intratextual connection
a citation = this is a unit-pair that has been specifically cited in tafsir literature by a scholar
4.1 Search: type in a verse, get ranked matches
Type in one or more verse references (a single verse, a range, or a scattered list) and the app returns the verses it considers most intratextually related, ranked highest to lowest. If you give it several verses at once, it ranks by what’s related to all of them on average — useful for exploring a whole passage or theme rather than a single line.
Reading View of Search Results
So you can see intratextual connections within context.
4.2 Explore map: the whole Quran as a landscape of clusters
A separate “Explore map” page projects every study unit’s fingerprint (embedding) down into a single 2D map you can pan and zoom, colored by which chapter it belongs to and sized by how often it’s cited in tafsir. Zooming around this map is a good way to build intuition for the shape of the whole embedding space at once (which chapters cluster together, and which verses stand out as unusually well-connected hubs).
recall: the relative positions of these verses in this map represent their ‘intratextuality’ to one another
4.3 Structural Analysis: Bird’s eye view of agreement and divergence
Complete Structural Analysis:
This is really the summary statistics of this data analysis. In this section, we consider all the pairs of citations across exegetes and calculate metrics like Jaccard similarities, Shannon’s entropy, and information gain. These help us determine how much each citation pair (verse X → Y) is in agreement across the pool of exegetes. We also then compare ground truth citation networks of the exegetes to the statistical model we’ve trained to find distinctiveness and cohesion of exegetes to the ‘statistically dominant patterns.
We can calculate things at 4 levels:
Per unit-pair (X → Y): an agreement score measured by “of the exegetes who show any engagement with either endpoint (X or Y), what fraction actually cite this specific connection (X→Y)?
High = broad consensus, low = only one or two idiosyncratic voices.
Per unit (X): a divergence score — Shannon entropy of the exegete-weighted distribution over its cited targets.
Low = exegetes converge on the same target (a consensus anchor verse), high = every exegete points somewhere different (a contested/ambiguous unit).
Per exegete: Complementary distinctiveness scores — how different is this exegete’s set of drawn connections (not just which units they touch) from every other exegete’s or the model’s?
Communities (Set of X units): Community detection directly on the unit-to-unit citation graph (weighted by the per-edge agreement score), with simple per-community size/cohesion stats.
Basically, at 4 levels, from a unique pair (edge) to a community of pairs, we get statistics regarding agreement and divergence between entities. This is one structural method to compare and contrast citations that gives us insight from a birds-eye-view instead of the detail and reasoning of particular connections.
In other words, once we have a network of citations and a model that can score every pair of verses for its ‘intratextuality’, we can do ‘math’ to calculate and answer subjective questions like “which 2 exegetes are similar in how they make connections?”, “which verses have a high rate of divergence in regards to how they are used to explain other verses?”, or “what are the set of verses that tend to be connected to each other across multiple scholars?”
The next section explores some of these questions.
5. Structural Observations and Analysis
Dr. Saeed’s finding, that different exegetes pick different connections, was based on close reading of one chapter. We structurally ask similar questions in this project at full scale: across all the tafsir works and every citation in the dataset, just how much do scholars agree or disagree, verse by verse and scholar by scholar — and does the model’s own sense of similarity line up with that pattern?
After some outlier removal, data cleanup, we do this over 35 medium-to-well represented exegetes and about 80,000 distinct cited connections to work with.
How much do scholars agree on any one connection?
For any specific connection between two verses, this asks: of the scholars who showed any engagement with either verse at all, what fraction actually drew this exact link? Nine independent scholars converging on the same connection out of a pool of ten who could have noticed it reads as near-consensus. One lone citation, buried in an otherwise-silent pool of many engaged scholars, reads as a single idiosyncratic voice — even if it’s the only data point available, the surrounding silence is itself informative.
Which verses are “settled,” and which are contested?
Flip the question around and ask it about a single verse rather than a single connection: when scholars do cite something else in relation to this verse, do they mostly converge on the same target, or does everyone point somewhere different? Some verses behave like a magnet — nearly every citing scholar lands on the same companion verse, a kind of consensus anchor. Others behave more like a crossroads, where equally serious scholars head off in many different, unrelated directions — a sign that the verse’s place in the wider text is genuinely open to interpretation rather than settled.
Do individual scholars have a citation “style” of their own?
Zooming out further, from single verses to whole careers: does a given exegete’s overall pattern of connections look like anyone else’s, or is it distinctive? This is checked two complementary ways — “how unusual is this scholar compared to a typical peer” and the stricter “is there even a single other scholar anywhere in the dataset who cites things similarly.” A scholar can look highly distinctive by the first measure yet still turn out to have one close counterpart by the second — the two questions aren’t quite the same, and both are worth asking.
Ex. al-lubab-fi-ulum-al-kitab (12,467 cross-references cited in total)
Distinctiveness (vs. a typical peer): 96%
Distinctiveness vs. closest peer: 73%
Most similar to: tafsir-al-razi, al-dur-al-masun, al-basit
Mean model score on own citations: 28%
Model surprise: 0.14
Model recall@50: 39%
Does the model’s sense of similarity match the tradition, or see something different?
For each scholar’s actual citations, does the model’s own learned similarity consider those connections obvious, or surprising? And separately, if you asked the model to guess a scholar’s citations from scratch, would its own best guesses actually include what that scholar really wrote?
Do citations cluster into neighborhoods?
Finally, treating every cited connection as a link in one giant web, a clustering pass checks whether verses naturally sort into tight-knit neighborhoods — groups of verses that reference each other far more than they reference anything else.
6. Limitations and Extensions
This research is not meant to be exhaustive or concretely answer one question. The purpose is to motivate a distant-reading data approach to certain exegetical research, particularly what can be framed through network science. The limitation of this current work is that it lacks domain expertise and verification in regards to its conclusion and research direction.
i.e. that is to say, the focus shouldn’t be on any conclusions derived from here but more so on the methodology and exploration that it makes possible!
There are various other visualization views and extensions that are possible with this base data, depending on the research question and application. This work selected some preliminary and intuitive approaches to contrast exegesis networks across a few dimensions. With further domain expertise, this work can be extended to focus and derive more in depth relational insights and verify them against existing established conclusions.
Some ideas for areas of extension
Increased model sophistication (technical): feature engineering, model architecture, data collection
Data verification: domain expertise to verify data extraction and networks
Insight Extraction: domain expertise to spot outliers, gaps, or heavily suggested conclusions within the structure and explore further to see if any valuable research questions or answers can be derived. Furthermore, connecting this structural network data to domain knowledge of time periods, schools, political leanings, etc. can uncover more meaningful structural elements. Furthermore, there is potential to connect this work with cross-domain scripture data (law, history, etc.) as well as extend it beyond the closed corpus of Quran (ex. include biblical networks!)
Integrate User Data: We currently compare scholarly patterns with statistical patterns. But to really make research like this operational, there is potential to connect it with mass-user patterns to see how intratextual linking amongst lay encounters with the quran match up to scholars and statistics.
AI comparison: We have looked at ground truth data (tafsir) and compared it to a machine-learning modeling approach. The natural next step is to test it against the intratextual connections coming from various LLM models: are AI models making the intratextual comparisons that you find in tradition or not?
and more…
7. Closing Remarks
I plan to make this data and model available for further exploration. I would once again caution against considering patterns within here conclusive or exhaustive as there was a lack of domain expertise available to verify data extraction. God Willing, I hope to connect this work with more domain experts to add novel research value in Quran Exegesis studies.






