Engineering Equity Look-through Analysis with Large Language Models
This article presents a practical engineering approach to building equity look-through systems with large language models. It covers the problem definition, the division of labor between LLMs and deterministic code, model versioning constraints, a five-layer pipeline architecture, evidence-backed structured extraction, graph-based indirect ownership calculation, layered evaluation metrics, common failure modes, cost and operations, and a phased rollout plan.
1. Problem Definition: What Equity Look-through Is and Why LLMs Fit
Equity look-through means starting from a target entity and tracing shareholding relationships upward to the ultimate beneficial owner, or breaking them down to the actual holders of underlying assets. It is not a single-point lookup but a composite task that combines multi-hop relational reasoning with numerical calculation. Common requirements include:
- Upward look-through: identifying the actual controller and ultimate beneficial owner, and determining whether a concerted-action relationship exists;
- Downward look-through: calculating an entity’s indirect ownership ratio in an underlying asset;
- Cycle detection: identifying structural loops formed by cross-shareholding or circular capital contributions;
- Change tracing: comparing snapshots from different points in time to output the path of control transfer.
Traditional implementations rely on rule engines and precise graph database queries. The advantage is deterministic results; the disadvantage is insufficient recall when facing unstructured materials such as announcements, business registration text, and scanned contracts, while rule maintenance costs grow linearly with the number of scenarios. The value of LLMs does not lie in replacing precise calculation, but in taking on the three dirtiest and most laborious jobs: unstructured information extraction, relation candidate generation, and natural language explanation, leaving deterministic computation to the program.
One engineering red line must be made explicit: numerical conclusions such as ownership ratios, dates, and amounts must be computed by code. The model is only responsible for extracting fields and generating explanations. Any design that lets the model directly “mentally compute” ownership ratios will become a source of incidents in production.
2. Engineering Constraints from the Model Iteration Cadence
Recently, several general-purpose LLMs in the industry have entered a “silent minor-version period”: after a flagship release, there are no minor upgrades for months, and vendors instead fill out their mid- and low-compute product lines to cover lightweight workloads, then return to the top of composite benchmark rankings with a new version. This pattern has three practical implications for engineering teams:
- The capability baseline drifts. The output distribution of the same prompt may change over time, so evaluation must be continuous rather than one-off.
- Tier selection becomes a cost lever. Extraction, classification, and rewriting tasks can be pushed down to lightweight tiers, while multi-hop reasoning and complex merging move up to higher-capability tiers, forming tiered invocation.
- Versions must be managed explicitly. Treating the model identifier as a configuration item rather than a hard-coded constant is the minimum requirement for avoiding “line jitter caused by silent upgrades.”
A configuration-based example:
# Model tiers and versions are externalized for canary release and rollbackMODEL_TIERS = {"extract": {"name": "light", "temperature": 0.0, "max_tokens": 2048},"reason": {"name": "pro", "temperature": 0.1, "max_tokens": 8192},"explain": {"name": "standard","temperature": 0.3, "max_tokens": 1536},}def call(tier: str, messages: list[dict]) -> str:cfg = MODEL_TIERS[tier]return llm.chat(model=cfg["name"], messages=messages,temperature=cfg["temperature"],max_tokens=cfg["max_tokens"])
3. Overall Architecture: A Five-Layer Pipeline
Split the system into five layers that communicate through structured contracts, so any layer can be replaced and load-tested independently.
- Collection layer: ingests multi-source heterogeneous data, unifies timestamps and source identifiers, and retains raw snapshots for traceability;
- Extraction layer: converts unstructured text into shareholding triples, with output required to include the location of the source span;
- Graph layer: carries relationships in a directed weighted graph, with edge attributes including ratio, date, and source confidence;
- Reasoning layer: multi-hop traversal, cycle detection, and indirect ownership calculation, all performed by deterministic algorithms;
- Generation layer: rewrites calculation results into readable conclusions and risk notes, with a citation chain attached.
For the collection layer, write raw files to object storage, put metadata in a relational database, and publish change events to a message queue to trigger incremental rebuilding. Connect full-pipeline logs and metrics to logging and monitoring services with alerting, forming a traceable closed loop.
4. Extraction Layer: Making Model Output Verifiable by Programs
The target artifact of extraction is triples, not free text. Enforcing structured output is the first gate against hallucination:
{"parent": {"name": "Company A", "id": "9110****", "confidence": 0.93},"child": {"name": "Company B", "id": "9110****", "confidence": 0.88},"ratio": 0.65,"as_of": "2025-12-31","evidence": {"doc_id": "d-88213", "span": [412, 486]}}
Four practical points:
- Mandatory evidence. Any field without a source span is discarded; the model is not allowed to fill gaps.
- Entity normalization. Name aliases, abbreviations, and historical renames must be aligned to a unique identifier through an entity resolution service, otherwise the graph will contain a large number of duplicate nodes.
- Confidence-based routing. Low-confidence edges go into a manual review queue rather than directly into computation.
- Unified units and definitions. Subscribed versus paid-in capital, direct versus indirect, voting rights versus dividend rights must be listed separately; mixing them is the main source of wrong conclusions.
5. Graph and Reasoning: Returning the Math to Code
Calculating indirect ownership is essentially summing path products. Suppose multiple paths exist from the target entity to an underlying node; the total ratio equals the sum of the products of ratios along each path:
def lookthrough(graph, src, dst, max_depth=8):total, stack = 0.0, [(src, 1.0, 0, [src])]while stack:node, acc, depth, path = stack.pop()if node == dst:total += acccontinueif depth >= max_depth:continuefor nxt, w in graph.out_edges(node): # w is a ratio from 0 to 1if nxt in path: # cycle pruningcontinuestack.append((nxt, acc * w, depth + 1, path + [nxt]))return round(total, 6)
Engineering practice also requires three additional capabilities: cycle detection to flag circular capital contributions; a depth limit to prevent traversal explosion caused by pathological data; and control of floating-point error in ratio accumulation through fixed-point or high-precision decimals. All intermediate paths should be exportable, because compliance scenarios require conclusions to be explainable down to the edge.
6. Evaluation System: Layered Metrics Instead of a Single Accuracy Number
Evaluation should be broken down by layer:
- Extraction layer: field-level precision and recall, with particular attention to structural gaps caused by missed extraction;
- Graph layer: entity resolution accuracy and duplicate node rate;
- Reasoning layer: absolute error of ratio calculation, with a tolerance threshold of one ten-thousandth recommended;
- Generation layer: citation coverage and conclusion consistency, meaning whether the written conclusion contradicts the calculation result.
The regression set must include hard cases: multi-level nesting, cross-shareholding, different entities with the same name, ratios that do not sum to 100%, and cross-period changes. Run the full regression every time the model tier changes, producing a version comparison report.
7. Common Failure Modes and Defenses
- Hallucinated numbers: the model provides a ratio with no evidence. Defense: field-level evidence validation and null blocking.
- Same-name confusion: different entities with similar names get merged. Defense: identifier first, name only as an auxiliary signal.
- Definition drift: direct ratios and voting-right ratios get mixed. Defense: strict schema constraints and enumerated fields.
- Depth truncation: branches are silently lost beyond the configured depth. Defense: explicit alerts on truncation.
- Time-point mismatch: an old snapshot is used to answer a current question. Defense: queries must carry
as_ofand undergo a freshness check.
8. Cost, Performance, and Operations
Tiered invocation can significantly reduce spend: extraction and rewriting use lightweight tiers, multi-hop reasoning uses higher-capability tiers, and results are cached with the graph version and query hash as the key. Batch offline jobs smooth peaks through a queue, while online queries set timeouts and fallback strategies; on fallback, return the deterministic algorithm result and label it “model explanation not enabled.” For observability, build dashboards for extraction field missing rate, average hops, cycle hit rate, and manual review rate, and configure threshold alerts.
9. Recommended Rollout Path
Phase one: build only extraction and graph construction, accumulating labels through manual review. Phase two: add deterministic reasoning, outputting conclusions and explanations separately. Phase three: introduce change tracing and risk scoring. Phase four: optimize tiers and govern cost. Throughout, hold to one principle: the model is responsible for understanding the world, and the program is responsible for computing the world. The clearer this boundary, the higher the system’s credibility in compliance scenarios.
