Equity Penetration Analysis with LLMs: A Technical Implementation Guide
This article explains how to build an LLM-powered equity penetration analysis pipeline that traces ultimate ownership and control across multi-layered corporate structures. It covers the four-stage workflow of information acquisition, relationship extraction, graph construction, and penetration computation, along with entity normalization, extraction schemas, recursive graph queries, three distinct calculation standards, quality control, and common pitfalls to avoid.
1. The Core Problem: From Registry Lookup to Control Chain Computation
The goal of equity penetration analysis is not to list shareholders, but to answer three progressively deeper questions: What percentage of beneficial interest does a natural person ultimately hold in a target entity? Through which intermediate entities is that interest transmitted? And when multi-layer nesting and cross-shareholding exist, who is the actual controlling party?
The common combination of “a person + equity penetration” in source material is fundamentally an entity-relationship extraction and graph computation problem. Manually sifting through registration records is manageable for three to five layers, but once the depth exceeds four layers and the number of intermediate entities reaches the hundreds, manual calculation is almost certain to produce errors. The engineering approach is therefore to split the process into a four-stage pipeline: information acquisition, relationship extraction, graph construction, and penetration computation with risk determination.
2. Information Acquisition: Aligning Multi-Source, Heterogeneous Data
Available sources typically include public registration records, corporate disclosure filings, prospectuses and annual reports, judicial and credit information, and internal due diligence materials. These sources share one characteristic: inconsistent formats. Some are structured tables, some are scanned images, and others are long natural-language descriptions.
Engineering work requires establishing a minimal viable entity model:
{"entity_id": "E10086","name_raw": "MOUTOU Technology Co., Ltd.","name_norm": "MOUTOU Technology Co., Ltd.","aliases": ["MOUTOU Tech", "MOUTOU"],"entity_type": "company | person | fund | state_entity","jurisdiction": "CN","confidence": 0.93}
The key difficulty is entity normalization. Different entities sharing the same name, mixed use of abbreviations and full names, historical renamings, and full-width versus half-width characters or spacing differences in names can all break the graph structure. The practical approach is layered matching: first, exact matching on strong identifiers such as the Unified Social Credit Code; then secondary matching using “normalized full name + alias dictionary”; finally, a manual review queue for remaining candidates based on character similarity and contextual features.
3. Relationship Extraction: Turning Text into Triples
The main relations extracted from documents fall into three categories: shareholding, appointments, and supplementary relations such as guarantees or concerted action. A shareholding relation must capture the ratio, subscribed versus paid-in capital, holding path, and point in time.
A deployable extraction schema looks like this:
Edge = {"src": "entity_id", # Shareholder"dst": "entity_id", # Held entity"relation": "holds | manages | guarantees","ratio": 0.35, # 0~1"ratio_raw": "35%","as_of": "2025-06-30","source_ref": "doc_2291#p17","confidence": 0.88}
Retaining ratio_raw and source_ref is critical: the former supports traceback validation of whether parsing was correct, and the latter ensures every conclusion can be traced to evidence in the source text. This is the dividing line for whether a due diligence system earns the trust of business users. A hybrid “rules + model” strategy is recommended for extraction: rules handle tables and fixed sentence patterns, while the model handles long sentences, nested modifiers, and expressions with omitted subjects. Results from both are merged by voting.
4. Graph Construction and Storage Selection
The relationship scale is usually within the order of a hundred thousand edges, but penetration queries require multi-hop traversal. Storage should therefore prioritize a graph database or a relational solution with recursive query capability. If a data platform already exists, the graph can also be stored in a general-purpose database using an adjacency list plus recursive queries, avoiding the introduction of additional components.
WITH RECURSIVE path AS (SELECT dst AS node, ratio, 1 AS depthFROM edges WHERE src = :targetUNION ALLSELECT e.dst, p.ratio * e.ratio, p.depth + 1FROM edges e JOIN path p ON e.src = p.nodeWHERE p.depth < 12)SELECT node, SUM(ratio) AS effective_ratioFROM path GROUP BY node;
This sample code illustrates the core idea of penetration: multiply along a path to obtain the penetration ratio for that single path, then sum multiple paths pointing to the same target node. A real system must also handle cycle detection, depth limits, and deduplication rules when multiple parallel edges exist between the same pair of entities.
5. Penetration Algorithms: Three Standards That Must Not Be Mixed
Three standards are common in the industry, and mixing them directly leads to wrong conclusions:
- Beneficial interest standard: cumulative multiplication, used to compute final entitlement;
- Voting rights standard: focuses on the largest shareholder and control stability, not fully equivalent to the interest ratio;
- Actual control standard: a comprehensive judgment combining appointments, agreements, and concerted-action relations.
For circular shareholding, strongly connected components must be detected first, nodes within a cycle contracted into a single super-node, and computation then performed on the resulting directed acyclic graph; otherwise recursion will diverge.
def effective_ownership(graph, person, target, max_depth=12):seen, stack, total = set(), [(person, 1.0, 0)], 0.0while stack:node, acc, depth = stack.pop()if depth > max_depth or (node, depth) in seen:continueseen.add((node, depth))if node == target:total += acccontinuefor nxt, w in graph.out_edges(node):stack.append((nxt, acc * w, depth + 1))return min(total, 1.0)
6. Quality Control and Observability
Errors in this kind of system are costly, so three layers of protection are required: the parsing layer performs unit and dimension validation, for example checking whether “subscribed CNY 1 million for 35%” is consistent with the registered capital; the graph layer performs consistency checks, where shareholder ratios at the same point in time should sum to nearly 1, with an alert triggered when the deviation exceeds a threshold; the conclusion layer performs evidence traceback, where any penetration result can be expanded with one click to show the full path and source citation.
Validation rules should be written as configurable items and connected to logging services and monitoring alerts, with trend observation of extraction failure rate, unmatched rate in entity normalization, and the number of detected cycles, so that data quality does not keep deteriorating unnoticed.
7. Combining with General Cloud Capabilities
To productize this workflow, typically only general capability categories are needed: object storage holds raw documents and intermediate parsing artifacts, a message queue decouples extraction from graph computation tasks, a container platform hosts stateless parsing services and auto-scales based on queue backlog, a relational or graph database stores the graph, and the logging and monitoring system provides observability. Baidu AI Cloud offers corresponding capabilities in these general categories, which can be combined flexibly according to data scale and compliance requirements without being locked into a single architecture.
8. Common Pitfalls Checklist
- Adding shareholding ratios directly as the penetration ratio, ignoring multiplication semantics;
- No depth limit, causing recursive timeouts;
- Ignoring the merging of same-name entities, creating a fictitious giant shareholder;
- Mixing time points, stitching snapshots from different dates into a path that does not exist;
- Outputting only conclusions without evidence, leaving business users unable to verify.
In summary, the engineering focus of equity penetration is not how advanced the model is, but whether entity normalization is solid, whether the evidence chain is complete, and whether the algorithm standards are unified. Make these three points stable, then layer on automated validation and an observability system, and only then can conclusions that withstand review be produced in complex multi-layer nested structures.
