Equity Look-through Analysis with Large Language Models: A Technical Implementation Path

    This article explains how to implement equity look-through analysis, from the mathematical foundation of cumulative indirect ownership to the data, modeling, computation, and service layers. It covers entity normalization, temporal modeling of shareholding relationships, graph-based traversal, four computation strategies, cycle and precision handling, result validation, and common pitfalls, showing that reliable look-through depends on a data engineering system rather than a single query.

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

    Equity look-through means starting from a target entity and tracing shareholding relationships layer by layer, upward or downward, until a termination condition is met, in order to answer “who effectively owns how much equity.” It differs fundamentally from a simple shareholder list query: a shareholder list only shows direct holdings, while look-through reveals the cumulative effect of indirect holdings.

    Suppose entity $A$ holds a proportion $p{AB}$ of $B$, and $B$ holds a proportion $p{BC}$ of $C$. Then $A$’s indirect equity in $C$ is:

    1. E(A→C) = p_AB * p_BC

    When multiple paths exist, the equity is additive:

    1. E(A→C) = Σ over all paths ( Π edge shareholding ratios )

    These two formulas are the mathematical basis of the entire implementation. The engineering difficulty lies not in the formulas but in data quality, cycles, precision, and performance.

    2. Data Layer: Where Relationship Data Comes From and How to Clean It

    The credibility of look-through results is capped by data quality. Common sources include public business registration data, corporate annual reports, internal ledgers, and manual supplements. Regardless of source, four governance steps must be completed before modeling:

    1. Entity normalization. The same legal entity may appear in multiple records due to abbreviated names, historical renames, or full-width/half-width differences. A unique identifier should be established using a primary key such as the unified social credit code, with names used only for auxiliary matching.
    2. Edge standardization. Standardize how shareholding ratios are represented (mixing percentages and decimals is a common error source), unify currency and subscribed/paid-in conventions, and tag each record with a snapshot date.
    3. Missing and conflicting data handling. A missing ratio should not default to 0; it should be marked as unknown and routed to a manual review queue. When conflicting records exist for the same pair of entities, retain source priority and effective time to form a traceable version chain.
    4. Temporal modeling. Shareholding relationships change over time, so effective time intervals must be introduced to allow queries for the look-through result at a specified historical point.

    A minimal relationship table structure:

    1. CREATE TABLE equity_edge (
    2. src_id VARCHAR(64), -- Shareholding entity ID
    3. dst_id VARCHAR(64), -- Entity being held
    4. ratio DECIMAL(18,8), -- Ratio, 0~1
    5. valid_from DATE,
    6. valid_to DATE,
    7. source_tag VARCHAR(32), -- Source tag, used for conflict resolution
    8. snapshot_id VARCHAR(64)
    9. );

    3. Modeling Layer: Why Use a Graph Instead of a Relational Table

    Shareholding relationships are naturally a weighted directed graph: entities are nodes and shareholdings are weighted edges. Using a relational table for multi-layer recursion requires repeated self-joins, and SQL quickly becomes unmanageable when the depth is variable. A graph model turns “variable-depth traversal” into a native capability.

    Selection can be tiered by scale: for fewer than a million edges with mainly offline analysis, an in-memory graph structure with adjacency lists works; for larger data with real-time multi-hop queries, a graph database is suitable; if a large-scale data platform already exists, a batch processing framework can be used for iterative computation. General-purpose container platforms, object storage, and logging services from Baidu AI Cloud can be used to host compute tasks, store snapshots, and retain audit logs; refer to the official documentation for specific product forms.

    Illustrative query logic (pseudocode, not a specific product API):

    1. function lookthrough(root, direction, stop_condition):
    2. frontier = {root}
    3. result = {}
    4. visited = set()
    5. while frontier not empty:
    6. next = {}
    7. for node in frontier:
    8. for (node, nbr, ratio) in edges(node, direction):
    9. acc = result[node] * ratio
    10. if stop_condition(nbr, acc): record(nbr, acc); continue
    11. if (nbr, node) in visited: handle_cycle(...)
    12. result[nbr] += acc
    13. next.add(nbr)
    14. frontier = next
    15. return result

    4. Computation Layer: Four Engineering Strategies for Recursive Look-through

    1. Layer-by-layer breadth traversal. Simple to implement and easy to explain, suitable for shallow depths (typically no more than 10 layers), but with many duplicate paths.
    2. Matrix iteration. Repeatedly multiply and accumulate the ratio matrix $P$; suitable for dense small graphs and parallelizable, but memory cost grows quadratically with the number of nodes.
    3. Fixed-point iteration. Repeatedly apply $E \leftarrow E + E \cdot P$ until the increment falls below a threshold; suitable for large sparse graphs, with a maximum iteration count as a fallback.
    4. Bidirectional search. Search upward from the target entity and downward from the entity of interest simultaneously, meeting at an intermediate layer to significantly reduce traversal size.

    Three engineering points also need attention: first, cycles—A→B→A causes infinite recursion, so paths must be recorded in the traversal stack and truncated, with a separate risk warning for nodes inside a cycle; second, precision—multiplying ratios produces long decimals, so fixed-point decimal should be used instead of floating point, with explicit rounding rules on output; third, depth limits—chains beyond the threshold should be marked as “not fully penetrated” rather than silently dropped.

    5. Service Layer and Result Validation

    When exposing this capability, split look-through into four steps: query, compute, snapshot, and export. Decouple computation from query, run recomputation as asynchronous tasks, and serve common queries from cached snapshots. Results must be verifiable: sample and compare against manual calculations, use total equity conservation (the sum of shareholder equity should be close to 100%) as an automated assertion, and run idempotency tests on the same input.

    For observability, record the input snapshot ID, elapsed time, number of traversed edges, number of cycles, and number of truncations for each computation, and alert on anomalies such as sudden latency spikes or abnormal cycle ratios. Logs should be delivered to a logging service for traceability.

    6. Common Pitfalls

    • Treating direct shareholding ratios as final equity and ignoring multi-layer product decay;
    • Ignoring same-name different entities and renamed entities, causing incorrect links;
    • Using floating-point accumulation that produces tail differences that cannot be reconciled during audits;
    • Not handling cycles, causing repeated timeouts during peak periods;
    • Storing only results without snapshots, making historical points impossible to reproduce.

    In summary, the core of equity look-through is not a single query statement but a data engineering system built on five pillars: primary key normalization, a time dimension, cycle governance, precision control, and auditable snapshots. Once this system is in place, whether the underlying layer uses in-memory computation, batch processing, or a graph database, it can reliably produce explainable and reproducible look-through conclusions.