Technical Implementation of Large Language Model-Based Equity Penetration Analysis

    This article outlines an engineering approach to equity penetration analysis, which traces ownership and control relationships upward from a target entity to identify ultimate beneficiaries and actual controllers. It explains how to model equity relationships as a weighted directed graph, govern multi-source heterogeneous data, and apply deterministic algorithms for indirect shareholding calculation and cycle handling. It also defines a practical role for large language models in entity extraction, entity resolution, and report generation, alongside guidance on system architecture, performance, traceability, and compliance. Readers will learn how to build a verifiable penetration analysis pipeline that balances accuracy with auditability.

    1. Why Equity Penetration Needs an Engineering Approach

    In scenarios such as equity investment, supplier onboarding, bid qualification review, and compliance due diligence, the hardest problem is often not a single missing data point but deliberately layered ownership chains that span multiple tiers. Equity penetration means starting from a target entity and tracing upward through investment, shareholding, and control relationships until you identify the ultimate beneficiary, the actual controller, and any concerted action relationships, while reconstructing the real control strength and benefit ownership.

    Traditional manual review of registration records and announcements is slow and prone to missed judgments. The value of introducing large language models here is not to have the model produce conclusions directly, but to convert unstructured text such as announcements, annual reports, and business change filings into a computable, verifiable relationship graph, which deterministic algorithms then use to perform penetration calculations. This division of labor is the technical foundation of the entire solution.

    2. Core Modeling: Representing Equity Relationships as a Weighted Directed Graph

    The most common engineering abstraction is a weighted directed graph: nodes represent entities (natural persons, legal entities, partnerships, asset management products, etc.), edges represent shareholding or control relationships, and edge weights represent percentages.

    1. from dataclasses import dataclass
    2. @dataclass
    3. class Node:
    4. id: str
    5. type: str # person / company / fund
    6. name: str
    7. @dataclass
    8. class Edge:
    9. src: str # contributor
    10. dst: str # investee
    11. ratio: float # direct shareholding ratio 0~1
    12. kind: str # equity / control / agreement

    Three easily overlooked details matter during modeling. First, entity deduplication must rely on joint judgment across multiple fields; matching on name similarity alone causes many incorrect merges. Second, ratio definitions must distinguish subscribed capital from paid-in capital, and direct from indirect holdings; mixing them distorts penetration results. Third, concerted action, voting rights delegation, and contractual control are not equity relationships, but they can materially change control conclusions, so they should be retained as separate edge types and weighted individually when calculating control strength.

    3. Data Layer: Governance Strategy for Multi-Source Heterogeneous Data

    Penetration quality is capped by data quality. In practice, data typically comes from business registration information, periodic reports of listed entities, judicial and administrative penalty disclosures, self-reported company materials, and third-party compliance databases. These sources commonly suffer from three problems: missing fields, inconsistent definitions, and delayed updates.

    A layered approach is recommended. The ingestion layer normalizes formats and unifies encoding; the cleansing layer handles name variants, administrative division suffixes, and former names; the alignment layer performs entity resolution using unique identifiers and attribute similarity scoring; the quality layer attaches a confidence score and source timestamp to each edge for later down-weighting by algorithms.

    1. -- Minimal viable design for the relationship table
    2. CREATE TABLE equity_edge (
    3. src_id VARCHAR(64),
    4. dst_id VARCHAR(64),
    5. ratio DECIMAL(9,6),
    6. kind VARCHAR(16),
    7. confidence DECIMAL(4,3),
    8. source_ts DATE,
    9. PRIMARY KEY (src_id, dst_id, kind, source_ts)
    10. );

    Keeping the source_ts and confidence fields is critical: the former supports time-sliced backtracking of historical control structures, while the latter lets algorithms automatically reduce conclusion strength when evidence is insufficient, rather than returning a seemingly certain but wrong answer.

    4. Penetration Algorithms: Ratio Multiplication and Cycle Handling

    The most basic indirect shareholding calculation is path multiplication: if the target entity reaches the ultimate beneficiary through two tiers, A and B, the indirect ratio equals the product of each segment’s ratio, and multiple paths are summed.

    1. def indirect_ratio(graph, start, target, memo=None):
    2. memo = memo or {}
    3. if (start, target) in memo:
    4. return memo[(start, target)]
    5. if start == target:
    6. return 1.0
    7. total = 0.0
    8. for e in graph.out_edges(start):
    9. if e.dst == target:
    10. total += e.ratio
    11. else:
    12. total += e.ratio * indirect_ratio(graph, e.dst, target, memo)
    13. memo[(start, target)] = total
    14. return total

    This naive recursion loops infinitely when cross-shareholding exists, so you must either introduce a visited-path set to cut cycles or switch to a matrix power series solution. A more robust engineering approach is to first perform strongly connected component decomposition, collapse each cycle into a super node, complete the multiplication on the resulting directed acyclic graph, and then substitute intra-cycle ratios back according to agreed rules. This avoids infinite loops and keeps results explainable.

    Determining control strength usually requires more than ratios; it also layers in board seats, voting arrangements, and veto clauses. A combination of thresholds and a rule engine is recommended: a ratio above a configured threshold directly determines control; below the threshold, the presence of a contractual control edge routes the case to a manual review queue rather than leaving the decision to the model.

    5. The Right Role for Large Language Models in the Pipeline

    Models are best suited for three tasks: extracting entities, ratios, dates, and other elements from long text; making semantic judgments on candidate pairs for entity resolution; and rewriting structured calculation results into readable due diligence narratives. They are not suited to directly outputting final controller conclusions, because ratio calculation is deterministic; delegating it to a model is neither reproducible nor auditable.

    A practical extraction constraint example:

    1. {
    2. "upstream": "entity",
    3. "downstream": "entity",
    4. "ratio": "number, 0-1",
    5. "effective_date": "date",
    6. "evidence_span": "source text snippet"
    7. }

    Requiring evidence_span to be returned allows each item to be traced back to the source text, and is the lowest-cost way to control hallucination. Before extraction results enter the graph store, they should also pass ratio range validation and date logic validation—for example, the sum of upstream shareholding ratios should not deviate significantly from a reasonable range, and change dates should not be later than the reporting period.

    6. Engineering Implementation and Performance Considerations

    At scale, graphs often reach tens of millions of edges, making single-machine recursion infeasible. A workable path is layered storage: raw evidence in object storage, structured relationships in a relational database, graph queries handled by a graph database or distributed graph computing platform, batch jobs decoupled through a message queue, and runtime metrics integrated into logging and monitoring alerting systems.

    On the compute side, separate online and offline pipelines. Online serves only shallow penetration (such as within three tiers) with caching; deep full penetration runs as offline batch processing, with results persisted for online reads. Cache keys must include a data version number; otherwise, stale conclusions will be returned after data updates.

    7. Risk Control and Compliance

    First, conclusions must be traceable: every ratio must map to an evidence snippet and data timestamp. Second, when confidence is insufficient, output a range or mark the item as pending verification rather than a single-point value. Third, when natural person information is involved, follow the principle of data minimization and apply masking and access auditing. Fourth, model versions and prompt strategies must be included in change management to ensure historical conclusions remain reproducible.

    8. Conclusion

    Equity penetration is fundamentally a data governance problem; the model is only one component that improves text processing efficiency. By making relationship modeling, entity resolution, cycle handling, and evidence traceability solid, and then having the large language model handle extraction and explanation, teams can balance accuracy with auditability. If the overall solution is built on general capabilities such as object storage, container platforms, and monitoring alerting from Baidu AI Cloud, the team can focus on the graph and algorithms themselves and deliver a verifiable penetration analysis service faster.