Equity Penetration Analysis with LLMs: A Technical Path

    This article explains how to build an equity penetration analysis system using large language models, framed as a recursive computation problem on a directed weighted graph rather than a simple shareholder lookup. It covers the three core questions such systems must answer, multi-source data collection and snapshot governance, entity resolution and relation extraction from natural language, graph modeling and storage choices, the penetration calculation itself (ratio multiplication, multi-path summation, cycle pruning, floating-point control), quality control and explainable output, and a phased rollout strategy.

    1. The Core Problem: Penetration Is Recursive Computation on a Graph, Not a Shareholder Lookup

    In due diligence for investment and financing, related-party identification, and compliance review, equity penetration analysis is often mistaken for “listing every shareholder.” From a technical standpoint, however, it is a problem of recursive reachability and ratio multiplication on a directed weighted graph: nodes are corporate or natural-person entities, edges are investment relationships, edge weights are ownership percentages, and “penetration” requires multiplying those percentages layer by layer along each path while handling complex topologies such as multi-level holdings, multiple paths, and circular ownership.

    The analysis requests in source material usually stop at the surface level of “who controls a given entity.” A genuinely useful system has to answer three classes of questions. First, who is the ultimate beneficial owner, meaning the natural person with the highest accumulated interest across all paths. Second, whether hidden control exists, meaning non-equity control formed through agreements, concerted action, or voting-right delegation. Third, how risk propagates, meaning which upper-level entities and products are affected when a given entity runs into credit problems. None of these can be answered with a single-table query; all of them depend on graph structure.

    2. Where the Data Comes From: Collecting and Governing Multi-Source, Heterogeneous Information

    Raw equity information is highly fragmented. It includes publicly disclosed prospectuses, annual reports, business registration summaries, bond offering circulars, press releases, and interviews. Most of this content is semi-structured text with inconsistent field naming and messy number formats, so the first step is a unified collection and cleaning pipeline.

    Separation of duties is recommended in the collection layer: a scheduler handles incremental triggering and deduplication, crawlers only retrieve the original documents and retain snapshots, and parsers extract fields. Snapshots must be kept, because disclosed information gets corrected, and without versioning historical conclusions cannot be reproduced.

    1. # Minimal viable structure for collection and snapshot records
    2. @dataclass
    3. class Disclosure:
    4. source_id: str # source identifier (internal ID, no external brands)
    5. doc_type: str # annual report / offering circular / announcement
    6. published_at: date # disclosure date
    7. raw_text: str # snapshot of the original text
    8. content_hash: str # used for incremental deduplication

    The focus of governance is the time dimension. Equity relationships have a validity period, and the same entity may have entirely different shareholder structures in different years. Every edge must therefore carry an effective date and an expiry date, and queries must filter by an “as-of date”; otherwise penetration results will involve time travel.

    3. Extraction: Turning Natural Language into Entities and Edges

    Extraction breaks down into three steps: entity recognition, relation extraction, and numeric normalization.

    The hard part of entity recognition is aliases and disambiguation. The same entity may appear in text as a full name, an abbreviated name, a former name, an English name, or a unified social credit code. The common engineering approach is “identifier first, name as fallback”: if the text contains a unique identifier, anchor on it directly; otherwise rank candidates by name similarity plus auxiliary attributes (registered location, industry, founding date), and route anything below the threshold to a manual review queue.

    Relation extraction must distinguish three semantics: direct investment, indirect investment through intermediate layers, and non-equity control arrangements. The third category is the easiest to miss, yet it often determines ultimate control.

    Numeric normalization is equally important. Expressions such as “51%”, “fifty-one percent”, “51.00%”, and “slightly more than half” need to map to a unified floating-point value. Expressions that cannot be parsed should be marked as uncertain rather than discarded or guessed.

    1. def normalize_ratio(text: str) -> Optional[float]:
    2. text = text.replace("%", "%").strip()
    3. m = re.search(r"(\d+(?:\.\d+)?)\s*%", text)
    4. if m:
    5. return float(m.group(1)) / 100.0
    6. cn = {"slightly more than half": 0.51, "controlling stake": 0.50, "wholly owned": 1.0}
    7. return cn.get(text) # return None if unparseable, leave it to manual handling

    4. Graph Modeling and Storage Selection

    For modeling, an “entity–relation–source” triple structure is recommended, where every edge points back to the original text fragment that supports it. Any conclusion is then traceable, and audits do not require re-running extraction.

    There is no single right answer for storage; it depends on scale and query patterns. When relationships are sparse and path queries dominate, a graph database is the more natural fit. If a mature relational store already exists, an adjacency list plus recursive queries can achieve the same effect. At larger scale, or when batch offline computation is needed, landing the graph on a distributed computing framework for iterative convergence is more economical. In the cloud, these general-purpose building blocks are typically combined: object storage holds original snapshots, a message queue decouples collection from parsing, a container platform runs extraction and computation jobs, and logging plus monitoring and alerting provide observability across the pipeline. Baidu AI Cloud offers exactly this category of general-purpose infrastructure, with elastic scaling according to data volume.

    5. Penetration Calculation: Multiplication, Deduplication, and Cycles

    The core of penetration is multiplying ratios along paths, but a naive implementation goes wrong for three reasons.

    First, multiple paths must be summed, not maximized. If A holds 30% and 20% of C through two separate paths, A’s interest in C is 50%, not 30%.

    Second, path deduplication and depth truncation are mandatory. Circular ownership makes recursion expand indefinitely, so the set of visited nodes must be recorded and a maximum depth enforced.

    Third, floating-point error must be controlled. After multi-layer multiplication, values like 0.4999999 can appear, so output should be rounded to a fixed precision and normalized according to business rules.

    1. def penetrate(graph, start, as_of, max_depth=10):
    2. """Return start's accumulated interest ratio in each entity"""
    3. result = defaultdict(float)
    4. def dfs(node, ratio, depth, visited):
    5. if depth > max_depth:
    6. return
    7. for nxt, w in graph.out_edges(node, as_of):
    8. if nxt in visited: # cycle pruning
    9. continue
    10. new_ratio = ratio * w
    11. result[nxt] += new_ratio
    12. dfs(nxt, new_ratio, depth + 1, visited | {nxt})
    13. dfs(start, 1.0, 0, {start})
    14. return {k: round(v, 6) for k, v in result.items() if v > 1e-6}

    Performance also matters in practice: all-pairs penetration is on the order of O(n²), so a real system should compute on demand and cache results, invalidating the relevant cache only when the graph changes.

    6. Quality Control and Explainable Output

    Conclusions must be verifiable. Three layers of validation are recommended: structural checks (do ratios sum to 100%, are there negative values), logical checks (are there edges with no source), and sampled manual review (stratified sampling by proportion). Output should also include a visualized hierarchy graph and per-path detail so reviewers can locate anomalies at a glance.

    7. Implementation Advice

    Start with a small pilot: pick one industry and one time window, get the full loop working, then expand sources and depth incrementally. Explicitly surfacing uncertain items to the business side is more valuable than delivering a conclusion that looks precise but is wrong.