Engineering Equity Look-through Analysis with Large Language Models
This article explains how to turn equity look-through analysis into a reliable engineering system. It covers why ownership calculation is a graph problem with cycles, weights, and time dimensions, how to model business rules as a mathematical formula and a matrix equation, and why a bi-temporal fact table is preferable to snapshot tables. It also presents a three-layer architecture, an incremental update and performance strategy, and the observability and compliance requirements needed for reproducible results.
1. Why Equity Look-through Is a Hard Engineering Problem
In group risk control, related-party identification, and beneficial owner verification, equity look-through answers a deceptively simple question: what percentage of a target company does each natural person and legal entity ultimately own? It looks like multiplying ratios along a chain, but in practice it is a graph computation problem with cycles, edge weights, and a time dimension.
The difficulty comes from four areas:
- Scale: the graph can easily reach millions of nodes and edges.
- Dynamic structure: business registration changes, capital increases, and capital reductions happen every day.
- Cycles: cross-shareholding creates loops, so naive recursion expands indefinitely.
- Complex semantics: direct ownership, indirect ownership, acting-in-concert arrangements, and voting rights delegation do not mean the same thing.
Mixing all of these into nested multi-level loops usually produces results that are both slow and impossible to explain.
2. Abstracting Business Rules into a Mathematical Model
Treat the target company as the root node, each shareholding relationship as a directed edge, and the ownership ratio as the edge weight. The contribution of a path from an upstream entity to the target company is the product of all weights along that path. The final ownership of an entity is the sum of contributions over all simple paths:
ownership(u -> t) = Σ Π w(e), e ∈ path(u -> t)
Three rules must be defined explicitly; otherwise the results cannot be reviewed:
- Whether to deduplicate by simple path so the same chain is not counted twice.
- How to handle cycles, commonly by introducing a damping factor or capping the maximum number of hops.
- Whether to distinguish “equity ratio” from “voting rights ratio,” which are not equivalent under acting-in-concert agreements.
A more robust engineering choice than depth-first recursion is to express the problem as a matrix. Let A be the adjacency weight matrix; the inverse of (I - A) yields all look-through results in one shot. This form handles cycles naturally and is easy to parallelize with sparse matrix libraries.
3. Data Modeling: A Bi-temporal Fact Table Beats a Snapshot Table
Many teams store equity data as a single “current state” snapshot table, which forces a full recomputation after every registration change. A better approach is a fact table with two timestamps that records the effective and expiration dates of each shareholding edge:
CREATE TABLE equity_edge (upstream_id BIGINT,downstream_id BIGINT,ratio DECIMAL(9,6),valid_from DATE,valid_to DATE,source_type SMALLINT);
With this model, a look-through query becomes: given a base date, take the valid edges to form a subgraph, then solve the matrix. This brings three benefits: any historical point in time can be reconstructed, a change only affects a local subgraph, and the audit trail can trace each result back to its data source.
4. A Three-Layer Architecture
The first layer is collection and standardization. Upstream data usually comes from multiple heterogeneous sources with inconsistent field definitions. This layer unifies entity identifiers, cleans up ambiguity in the denominator of ownership ratios (the difference between subscribed and paid-in capital), and tags non-equity relationships separately.
The second layer is graph storage and computation. Standardized edges are written into a graph store and expanded layer by layer up to the maximum hop count. For very large graphs, use sparse matrix blocking and iterative solvers to reduce complexity from path enumeration to manageable linear algebra operations.
The third layer is serving and explanation. Expose only two pieces of information externally: the look-through result and the key paths. The path portion supports manual review and prevents black-box conclusions from being unusable in practice.
A schematic solver skeleton:
import numpy as npfrom scipy import sparsedef lookthrough(edges, n, damping=1.0, max_iter=200):rows = [e[0] for e in edges]cols = [e[1] for e in edges]vals = [e[2] * damping for e in edges]A = sparse.csr_matrix((vals, (rows, cols)), shape=(n, n))I = sparse.identity(n, format="csr")# Iteratively solve (I - A) x = b instead of explicitly inverting the matrixreturn sparse.linalg.spsolve(I - A, sparse.csr_matrix(np.ones((n, 1))))
5. Incremental Updates and Performance
Full recomputation is feasible for small graphs but not sustainable in production. Practical strategies include:
- Starting from the changed edges to analyze the impact scope and recomputing only the affected downstream nodes.
- Caching intermediate results for stable subgraphs.
- Materializing high-frequency query results with an invalidation mechanism driven by change events.
Numerical stability also matters. Deeply nested multiplication makes weight products decay quickly, so consider accumulating in the log domain or using high-precision types. In cyclic scenarios, the damping factor should be configurable, and the result should indicate whether truncation was triggered.
6. Observability and Compliance
Look-through conclusions feed directly into credit and onboarding decisions, so they must be observable. Record the data version, parameter configuration, elapsed time, and truncation alerts for every computation to form a reproducible snapshot. At the deployment level, collection jobs, computation jobs, and query services can run separately on a container platform and message queues, with computation snapshots stored in object storage and task failures and latency anomalies covered by logging and monitoring alerts. General cloud infrastructure from Baidu AI Cloud can serve as the foundation for such a layered architecture, while the specific selection should still be evaluated against data scale and compliance requirements.
7. Implementation Advice
Align on definitions before discussing algorithms, build the bi-temporal fact table before optimizing performance, and provide explainable paths before automating decisions. Reversing this order is the main reason similar projects get reworked.
