Engineering Equity Penetration Analysis with Large Language Models

    This article explains how to build an engineering-grade equity penetration system that combines large language models with graph databases and computation engines. It covers a four-layer architecture, entity resolution strategies, the directed weighted graph model and penetration algorithm, the appropriate role of LLMs, performance and incremental updates, and common pitfalls with acceptance testing recommendations. Readers will learn how to keep model outputs auditable while ensuring accurate beneficial ownership calculations.

    1. Why Equity Penetration Needs an Engineering Approach

    In scenarios such as equity investment, vendor onboarding, compliance review, and risk monitoring, business teams often need to answer a question that looks simple but is actually complex: who is the ultimate controller of a company, whether there is a multi-layer nested ownership structure behind it, and what the final beneficial ownership percentage is. Manually reviewing public information is manageable for a small number of entities, but once the number of entities grows to hundreds or thousands and the relationship depth exceeds five or six layers, manual methods fail on both efficiency and consistency.

    The maturity of large language model (LLM) technology provides a new interaction entry point for this kind of analysis: users can describe the analysis goal in natural language, and the model can assist with information extraction, relationship summarization, and query intent parsing. However, it must be clear that the model itself does not hold authoritative registry data. What it is good at is understanding semantics, organizing queries, and explaining results, rather than serving as the ultimate source of facts. Therefore, the correct engineering posture is “the model handles understanding and orchestration, while the graph database and computation engine handle facts and computation.” Only with a clear boundary of responsibilities can the system ensure both user experience and auditability.

    2. Overall Architecture: Four Layers of Responsibility

    A deployable equity penetration system can typically be split into four layers.

    The first layer is the data ingestion layer. Sources of equity information include public business registration data, disclosure documents from listed companies, tender and procurement announcements, and judicial and administrative penalty documents. From an engineering perspective, an extraction template needs to be defined for each type of source, and the source identifier and crawl time need to be recorded to support later traceability.

    The second layer is the entity resolution layer. The same company may appear in different sources as a full name, an abbreviation, a region prefix in parentheses, a historical former name, and other forms. It must be normalized to a unique entity identifier; otherwise, the graph will contain a large number of “fake nodes,” and penetration results will naturally be distorted.

    The third layer is the graph storage and computation layer. Ownership relationships are described with a directed graph, where nodes represent legal entities or natural persons and edges represent ownership behavior, with attributes such as ratio, date, and source carried on the edges. Penetration computation is essentially multi-hop traversal and ratio conversion on this graph.

    The fourth layer is the interaction and presentation layer. It is responsible for translating the user’s natural language request into a graph query, returning computation results in the form of a path tree, a Sankey diagram, or a table, and annotating key conclusions with their data sources.

    3. Entity Resolution: The Foundation of Penetration Accuracy

    The quality of entity resolution directly determines whether upper-layer conclusions are trustworthy. In practice, a dual-track strategy of “deterministic rules first, similarity models as fallback” is recommended. Deterministic rules include exact matching of the Unified Social Credit Code, registration number matching, and combined matching of address and legal representative; the similarity fallback handles cases such as name edit distance, alias dictionaries, and historical name mappings.

    The illustrative merging logic can be expressed as:

    1. def resolve(name, credit_code=None, aliases=None):
    2. if credit_code and (eid := exact_index.get(credit_code)):
    3. return eid
    4. for alias in (aliases or []):
    5. if (eid := exact_index.get(alias)):
    6. return eid
    7. cands = fuzzy_index.search(normalize(name), top_k=5)
    8. if len(cands) == 1 and cands[0].score > 0.92:
    9. return cands[0].eid
    10. return create_or_hold(name) # low-confidence matches enter the manual review queue

    The key design point is that low-confidence match results should not be silently merged but should enter a manual review queue. Errors caused by silent merging will be amplified layer by layer along the graph, ultimately manifesting as high-cost problems such as “incorrect ultimate controller determination.”

    4. Graph Model and Penetration Algorithm

    When modeling, it is recommended to design ownership edges as directed and weighted: the direction points from the holding party to the held party, and the weight is the ownership ratio (a decimal between 0 and 1). The goal of penetration is to compute the final beneficial ownership ratio of a specified entity in a target company, which is the sum of the products of ratios along all acyclic paths.

    1. result = 0
    2. for path in all_simple_paths(graph, source=target, target=root, max_depth=8):
    3. w = 1.0
    4. for edge in path:
    5. w *= edge.ratio
    6. result += w

    There are three engineering details that must be handled here.

    The first is cycles. Cross-shareholding is very common in reality. If paths are not restricted to simple paths, traversal will fall into an infinite loop. Limiting the maximum depth is an engineering compromise, but the result needs to be annotated with “did not converge within the depth threshold” to avoid treating a truncated result as a complete conclusion.

    The second is distinguishing between different entities with the same name and multiple names for the same entity. The former leads to incorrect edges, while the latter leads to broken paths; both depend on the quality of the entity resolution layer.

    The third is missing ratios. Some sources only disclose qualitative descriptions such as “controlling stake” or “minority stake” without specific values. It is recommended to set interval estimates for such edges and output confidence intervals in the result, rather than filling in a seemingly precise but fake number.

    5. The Reasonable Position of LLMs in the Pipeline

    Models can create real value in three stages, none of which overstep boundaries.

    The first is query intent parsing. A request like “help me see how many layers there are from this company to the ultimate natural person and who holds how much at each layer” is parsed into structured graph query parameters, including the start point, end point type, maximum depth, and whether to output intermediate nodes.

    The second is unstructured text extraction. Paragraphs in disclosure documents are converted into candidate triples, and the output must be accompanied by the original text fragment and location for manual spot checks.

    The third is result explanation. The computed paths and ratios are organized into a readable hierarchical description, with hints given for abnormal structures (such as multi-layer nesting, circular shareholding, or ratios that do not sum to 1).

    It needs to be emphasized that both the extraction and explanation stages should retain the ability to “trace back to the original text,” which is a hard requirement in audit scenarios.

    6. Performance and Incremental Updates

    When the number of entities reaches the hundreds of thousands and the number of relationship edges reaches the millions, full recomputation is unrealistic. Feasible strategies include: caching results by entity dimension and setting invalidation conditions; recomputing only the affected subgraph for newly added or changed edges; and making queries with large depth asynchronous, returning shallow-layer results first and then completing deep-layer paths. On the storage side, general-purpose graph databases or the recursive query capabilities of relational databases can be used, combined with object storage to save original extraction documents, a message queue to decouple crawling from ingestion, a container platform to host computation tasks, and logging services with monitoring and alerting to track task success rate and latency.

    7. Common Pitfalls and Acceptance Recommendations

    The first pitfall is treating model output as factual conclusions. The correct approach is for the model to output candidates, with rules and data validation making the final decision. The second pitfall is ignoring the time dimension; ownership relationships expire as changes occur, so every edge should carry an effective time and support traceback by point in time. The third pitfall is showing only the final ratio without showing the path, making the conclusion impossible to review.

    For acceptance, it is recommended to prepare three types of samples: single-level simple ownership, nesting of three or more layers, and cross-shareholding with cycles, to verify the correctness of ratio conversion, depth truncation, and cycle handling respectively, and to measure the accuracy and manual review rate of entity resolution, forming a baseline for sustainable iteration.