Equity Penetration Analysis with LLMs: Technical Practices
This article explains how to treat equity penetration as a graph traversal and recursive aggregation problem. It covers data modeling for ownership disclosures, a recursive algorithm with cycle suppression, result validation for reproducibility, and a general cloud architecture. It also lists common pitfalls, such as confusing equity ratio with voting rights.
1. Why Penetration Is a Graph Problem
In compliance review, investment research, and risk control, teams often need to answer a deceptively simple question: how much effective control does a natural person or institution ultimately hold in a target company? This looks like a single lookup, but it is a typical graph traversal and recursive aggregation problem.
Model each entity as a node and each “investment/ownership” relationship as a directed edge weighted by the ownership percentage. The result is a directed weighted graph. Penetration means starting from the target node, recursively traversing edges backward (or forward) until reaching terminal nodes with no upstream investors, multiplying the ratios along each path, and accumulating the results per node.
Three rigor requirements must be stated up front:
- Define the ratio semantics clearly. Direct and indirect ownership use different conventions. Multiplying ratios layer by layer yields an “equity ratio,” which is not the same as a “voting rights ratio.”
- Handle cycles. Cross-shareholding is common in practice. Without cycle detection, recursion can become infinite or results can diverge.
- Keep precision under control. Floating-point multiplication accumulates error across multiple layers. Use fixed-point numbers or fractions throughout.
2. Data Modeling: Turning Unstructured Disclosures into Computable Structures
Real data often comes from scattered disclosure texts. The first step is extraction and normalization.
Entity(EntityID, Name, Type) Type ∈ {Natural Person, Institution, Target Company}Relationship(InvestorID, InvesteeID, Ratio, Currency, Subscribed Amount, Data Date)
Follow a few engineering constraints when modeling:
- Use stable hashes for entity IDs to avoid false merges caused by identical names.
- Attach a data date to every relationship. Filter by a “same point-in-time snapshot” during penetration to prevent mixing data across periods.
- Standardize ratio fields as fixed-point decimals from 0 to 1, and retain the original text for traceability.
- Mark cases where only the subscribed amount is disclosed without a ratio as pending completion; exclude them from automatic calculation.
3. Penetration Algorithm: Recursive Aggregation and Cycle Suppression
The core logic can be expressed in pseudocode:
def penetrate(target_id, edges, max_depth=20):# acc: terminal entity -> accumulated equity ratioacc, visited = {}, set()def walk(node, ratio, depth, path):if depth > max_depth or node in path:acc[node] = acc.get(node, 0) + ratioreturnparents = edges.incoming(node)if not parents:acc[node] = acc.get(node, 0) + ratioreturnfor p in parents:walk(p, ratio * p.ratio, depth + 1, path | {node})walk(target_id, 1.0, 0, frozenset(visited))return acc
Three additional engineering tasks are needed: first, replace recursion with an explicit stack to avoid hitting the call stack limit on deep chains; second, memoize results per node to reuse repeated subpath computations; third, emit an alert when depth exceeds a threshold, indicating a possible abnormal broken link in the data.
4. Result Validation: Making Conclusions Reproducible
The biggest risk with penetration results is “computed but not explainable.” Build three layers of validation:
- Conservation check: the accumulated equity of a terminal entity should not exceed 1. Exceeding it indicates duplicate edges or incorrect cycle handling.
- Sampled traceback: randomly select several paths and output the complete chains for manual review.
- Dual-implementation comparison: compute once with a graph query and once with a script recursion. Intercept if the difference exceeds a threshold.
5. Implementation and General Cloud Capabilities
On the cloud, combine general capability categories: use object storage for raw disclosure files, a message queue to decouple extraction and computation tasks, a container platform to run the penetration computation service, and logging and monitoring with alerts to track task success rate and latency. In such scenarios, Baidu AI Cloud typically provides support through the general combination of “storage + compute + containers + observability,” rather than a single proprietary interface.
6. Common Pitfalls
- Simply adding direct ownership as the final equity, ignoring layer-by-layer multiplication.
- Ignoring concerted action relationships, leading to biased control judgments.
- Mixing the latest data with historical data, making conclusions unreproducible.
- Failing to distinguish equity ratio from voting rights ratio, leading to wrong conclusions in governance analysis.
In summary, the reliability of equity penetration comes from three things: clear definition of conventions, strict cycle and precision handling, and a traceable validation mechanism. Making these three solid gives the analysis engineering credibility.
