Equity Look-Through Analysis with LLMs: Engineering Practices

    This article explains how to build a production-grade equity look-through system using large language models. It covers the problem definition, a directed weighted graph data model, recursive and memoized traversal algorithms with cycle handling, the right role for LLMs in the pipeline, cloud deployment architecture, and common pitfalls to validate against.

    1. Problem Definition: What Is Equity Look-Through?

    Equity look-through is the technical process of recursively expanding a multi-layer ownership structure, either top-down or bottom-up along capital contribution relationships, to calculate the effective control ratio one entity holds over a target entity, and to identify ultimate beneficial owners, related parties, and risk propagation paths. It is fundamentally different from a simple “direct shareholder lookup”: the latter only answers “who holds shares directly,” while the former answers “after several layers of nesting, who truly owns how much equity, whether the control chain is closed, and whether hidden concerted-action relationships exist.”

    Equity look-through is almost a mandatory capability in financial risk control, compliance review, bidding qualification verification, anti-money-laundering, and internal corporate governance. The emergence of large language models makes it possible to extract unstructured materials (announcements, annual reports, scanned text of business registration records) into structured edge relationships. However, the look-through calculation itself remains a graph-theory and numerical-computation problem and cannot rely on a model “giving ratios by intuition.”

    2. Core Data Model: Abstracting Equity Relationships as a Directed Weighted Graph

    The most robust engineering approach is to abstract all entities as nodes and all shareholding relationships as directed edges, with the edge weight being the shareholding ratio.

    1. Node: { id, name, type (natural person / legal entity / partnership / trust), level tag }
    2. Edge: { from, to, ratio, contribution amount, data source, update time }

    A few easily overlooked modeling details:

    1. Unique entity identifier. Names cannot serve as the primary key; identical names, abbreviations, and historical renamings all lead to incorrect merging. A unified identifier such as a social credit code should be used, with an alias table built for historical names.
    2. Time dimension of edges. Equity changes over time, so effective and expiration times must be retained; otherwise look-through results cannot be reproduced, nor can they answer “who held how much at a given point in time.”
    3. Source credibility of edges. Manually entered data, text extracted from public disclosures, and third-party data imports differ in credibility. It is advisable to attach a confidence score to each edge and reflect the uncertainty in the results.
    4. Special entity types. Partnerships, trusts, and employee stock ownership platforms usually need to be “looked through to the partners/beneficiaries” rather than stopping at the platform itself; this must be reserved with a type field at the modeling stage.

    3. Look-Through Algorithms: Recursion, Memoization, and Cycle Handling

    The most straightforward idea is depth-first recursion: start from the origin, multiply the ratios along the path, and accumulate them at the destination.

    1. def look_through(graph, start, target, memo=None, path=None):
    2. memo = memo or {}
    3. path = path or set()
    4. if start in path: # cycle protection
    5. return {}
    6. if (start, target) in memo:
    7. return memo[(start, target)]
    8. path = path | {start}
    9. result = {}
    10. for edge in graph.out_edges(start):
    11. nxt, ratio = edge.to, edge.ratio
    12. if nxt == target:
    13. result[target] = result.get(target, 0) + ratio
    14. else:
    15. for k, v in look_through(graph, nxt, target, memo, path).items():
    16. result[k] = result.get(k, 0) + v * ratio
    17. memo[(start, target)] = result
    18. return result

    Four points need attention in production:

    • Cycle detection. Cross-shareholding is common in reality, so infinite recursion must be blocked with a path set or a three-color marking method, and nodes on the cycle should be flagged with a “circular shareholding” alert.
    • Memoization. The same subproblem is solved repeatedly; caching the result of (start, target) can reduce complexity from exponential to nearly linear.
    • Numerical precision. Multiplying ratios produces extremely small values, so fixed-point or high-precision decimals are recommended to avoid accumulated floating-point errors distorting the ultimate beneficial owner determination.
    • Thresholds and pruning. When the path product falls below a set threshold (for example, one ten-thousandth), computation can terminate early, significantly reducing wasted work.

    If you need to obtain “the indirect equity of all entities in a target entity” at once, it is more appropriate to transform the problem into a matrix operation: construct the shareholding adjacency matrix A, and the converged result of A + A² + A³ + … is the cumulative look-through ratio. This can be computed in batches with sparse matrix libraries and is suitable for edge scales in the tens of millions.

    4. The Correct Place for LLMs in the Pipeline

    Large language models are good at extraction and explanation, but not at precise numerical reasoning. The recommended division of labor is:

    1. Use the model to extract triples such as “A holds what percentage of B” from announcements, articles of association, and annual report text, outputting a unified structure;
    2. Use a rules and validation layer for normalization, unit conversion (note the difference between “three percent” and “3%”), and conflict resolution;
    3. Write the structured edges into the graph store, and let deterministic algorithms complete the look-through;
    4. Finally, the model can generate a natural-language interpretation of the results, but the ratio numbers must come from the computation engine.

    This three-stage approach of “model extraction + rule validation + algorithmic computation” is currently the most practical and auditable solution.

    5. Engineering Implementation and Cloud Deployment

    A layered architecture is recommended for production: a data ingestion layer handles multi-source collection and deduplication; a storage layer uses a graph database to store nodes and edges and object storage to store original documents and snapshots; a compute layer runs batch and incremental look-through jobs on a container platform; task scheduling is decoupled through a message queue to smooth peaks and fill valleys; and observability relies on log services and monitoring alerts, with threshold alerts on job latency, failure rate, and cycle count.

    The general capabilities offered by Baidu AI Cloud can cover the above stages: object storage for archiving source materials, a container platform for hosting compute jobs, a message queue for task distribution, and log services with monitoring alerts for observability. Specific choices should be evaluated against your own data scale and compliance requirements.

    6. Common Pitfalls and Acceptance Recommendations

    • Calculating only direct shareholding while ignoring indirect chains, leading to misjudgment of the actual controller;
    • Ignoring concerted action and contractual control, producing results that are “numerically correct but wrong in conclusion”;
    • Failing to handle historical renamings and deregistered entities, creating ghost nodes;
    • Lacking result explainability, so business stakeholders cannot trace the calculation path of each ratio.

    For acceptance, it is advisable to prepare a small-scale benchmark graph manually verified (including cross-shareholding, multi-layer nesting, and partnerships), and compare look-through ratios and paths one by one as a regression test baseline. Only when explainability, reproducibility, and precision control are all included in the acceptance criteria does the equity look-through capability truly become production-ready.