Engineering Equity Look-Through Analysis with Large Language Models
This article explains how to build an engineering-grade equity look-through analysis system, covering the problem definition, layered architecture, data modeling and cleaning, recursive traversal with cycle detection, ownership aggregation and control determination, performance optimization, and common pitfalls. It shows how to make termination conditions, time semantics, and cycle strategies explicit so the results remain auditable and reproducible at the scale of tens of millions of edges.
1. Problem Definition: What Is Equity Look-Through?
Equity look-through is the process of expanding along ownership relationships layer by layer (downward or upward) until all nodes meet the termination conditions, and then computing the ultimate beneficial ownership ratios, actual control paths, and risk exposure. It is essentially a problem of multi-source traversal and path aggregation on a directed graph, not a simple table lookup.
In engineering practice, the system usually needs to answer three types of questions:
- Direct layer: which companies an entity directly holds, and at what ratio;
- Indirect layer: the ratio held indirectly through intermediate companies;
- Control layer: who the ultimate beneficial owner is, whether the control chain is stable, and whether there are signs of nominee holding or concerted action.
It is important to emphasize that look-through results are highly sensitive to the “termination conditions.” Common termination conditions include: a holding ratio below a threshold (such as 1%), reaching a natural person or a state-owned entity, reaching a listed entity, or reaching the maximum number of layers (such as 10). Different thresholds can lead to completely different conclusions, so the parameters must be made explicit and versioned.
2. Overall Architecture
A robust look-through analysis system is typically divided into five layers:
- Data ingestion layer: connect to business registration data, internal ledgers, announcements, and contract information, and normalize everything into a four-tuple of “entity—relationship—ratio—time”;
- Storage layer: a relational database stores entities and evidence, a graph database or adjacency table stores relationships, and object storage archives the original files;
- Computation layer: recursive traversal, cycle detection, ratio aggregation, and control determination;
- Service layer: provide both synchronous query and asynchronous task modes, with heavy tasks decoupled through a message queue;
- Presentation layer: hierarchy trees, Sankey diagrams, path listings, and audit logs, combined with monitoring and alerting.
For cloud deployment, container platforms can host the computation tasks, a message queue can handle task distribution, log services and monitoring alerts can track the execution of long-running tasks, and object storage can save a snapshot of each analysis for reproducibility.
3. Data Model and Cleaning
A minimal viable model is suggested below:
Entity(id, name, type) # type: company / natural person / fund / otherRelation(src_id, dst_id, ratio, effective_date, source)
The cleaning stage must handle four types of dirty data:
- Inconsistent ratio semantics: subscribed versus paid-in capital, and direct versus indirect holdings mixed together, which must be unified into “direct holding ratio”;
- Time overlap: historical changes that have not expired, where the latest valid edge must be selected by effective time;
- Duplicate entity names: use a unified identifier as the primary key, with the name used only for display;
- Missing ratios: these must not default to 0 or 100, but should be marked as unknown and routed to a manual review queue.
4. Recursive Look-Through and Cycle Detection
The most straightforward approach is depth-first traversal, but cycles are extremely common in real data (cross-shareholding, nested employee stock ownership platforms). A schematic implementation is shown below:
def lookthrough(start, edges, max_depth=10, threshold=0.01):result = {} # terminal node -> accumulated ratiovisited = set() # nodes on the current path, used for cycle detectiondef dfs(node, acc, depth):if depth > max_depth or node in visited:returnout = [e for e in edges.get(node, []) if e.ratio >= threshold]if not out:result[node] = result.get(node, 0.0) + accreturnvisited.add(node)for e in out:dfs(e.dst, acc * e.ratio, depth + 1)visited.remove(node)dfs(start, 1.0, 0)return result
The key point is that visited must be the “current path set” rather than a global set, otherwise multiple parallel paths will be missed; acc uses multiplicative accumulation, which naturally expresses the “multiply layer by layer” semantics of look-through.
5. Ratio Aggregation and Control Determination
The look-through ratio is the sum of the products of ratios along each complete path. When the same terminal node is hit by multiple paths, the ratios are accumulated rather than taking the maximum.
Control determination cannot rely on ratios alone. It is recommended to introduce three parallel rules:
- Absolute control: the sum of direct and indirect ratios exceeds 50%;
- Relative control: being the largest shareholder and significantly ahead of the second largest;
- Agreement-based control: the existence of evidence such as concerted action or voting rights delegation, which is determined as control even at a low ratio.
In engineering terms, the “ratio conclusion” and the “control conclusion” should be output in separate fields, to avoid mixing computational facts with legal judgments.
6. Performance and Engineering Optimization
- Caching: cache results for immutable historical snapshots, and invalidate by the affected subgraph when changes occur;
- Pruning: filter out edges below the threshold at the ingestion stage, which can compress the scale by an order of magnitude;
- Parallelism: shard by starting node, distribute through a message queue, and scale elastically on the container platform;
- Incrementality: recompute only the affected set of starting nodes, with version numbers for idempotency;
- Observability: record the parameters, data version, and elapsed time of each task for auditing and regression.
7. Common Pitfalls
- Mistaking indirect ratios for direct ratios, causing double counting;
- Ignoring the time dimension and drawing outdated conclusions from old business registration data;
- Failing to detect cycles, resulting in infinite recursion or inflated ratios;
- Setting the threshold too low, causing the result set to explode with heavy noise;
- Outputting only ratios without paths, making the conclusions impossible to review.
8. Conclusion
The engineering essence of equity look-through is to combine “relationship data + explicit parameters + reproducible algorithms” into auditable conclusions. As long as termination conditions, time semantics, and cycle strategies are explicitly managed, and caching, pruning, and parallelism are added, results can be produced reliably at the scale of tens of millions of edges. For teams that want to build this capability in-house, it is recommended to first run a small-scale validation on a general-purpose graph computing framework, then gradually migrate to a containerized, task-queue architecture, and connect log and monitoring systems to ensure long-term operability.
