Equity Penetration Analysis with Large Language Models: A Technical Path
This article outlines an engineering approach to equity penetration analysis using large language models. It covers the core concepts and formal definitions of equity versus control, a four-step pipeline for extracting entity and ownership relations from unstructured text, graph storage options at scale, and key implementation details of the recursive penetration algorithm, including pruning thresholds, depth limits, and cycle handling. It also discusses common pitfalls in ratio semantics and time handling, a reusable layered cloud architecture, and evaluation practices based on annotated datasets and evidence chains.
1. Why Equity Penetration Needs Engineering
In scenarios such as equity investment, supplier onboarding, compliance review, and related-party transaction screening, looking only at the first layer of shareholders in business registration records is rarely enough to determine the real control structure. The goal of equity penetration is to reconstruct the entities and capital contribution relationships scattered across different levels and text sources into a computable graph, and to answer three questions: who ultimately controls the company, how long the control chain is, and whether circular contributions or hidden concerted action exist.
Raw source material often mixes in model version updates and benchmark rankings. That kind of content is highly time-sensitive product news and has no direct bearing on the methodology of equity penetration. This article strips out those unverifiable product details and keeps a single valuable technical theme: how to reliably extract relationships of the form “entity A contributes a given ratio to entity B” from massive volumes of text, and then compute them recursively across multiple layers.
2. Core Concepts and Formal Definitions
Map the business concepts to a graph structure before discussing implementation.
- Nodes: legal entities, natural persons, partnerships, state-owned funding platforms, all abstracted uniformly as
Entity. - Edges: contribution relationships, with attributes for contribution ratio, subscribed amount, paid-in amount, contribution date, and data source.
- Penetration: starting from a target node, traverse edges with weighted multiplication to obtain the final equity coefficient of each path, then sum over the same terminal node.
Formally, for a path A -> B -> C with ratios p1 and p2, the direct equity of A in C is p1 * p2; if multiple paths exist, the values are accumulated.
Equity(A, X) = sum over paths( p1 * p2 * ... * pn )Control(A, X) = there exists a path where every ratio is >= threshold τ
Distinguishing “equity” from “control” is critical: the former is a continuous quantity computed by multiplication and accumulation, while the latter is a boolean judgment with a threshold. Mixing the two is the most common source of definitional errors in practice.
3. Data Acquisition and Entity-Relation Extraction
The raw carriers of equity information are usually unstructured or semi-structured text, such as announcements, excerpts of articles of association, tender documents, and press releases. Engineering-wise, this breaks into four steps:
- Text cleaning and sentence splitting. Remove headers, footers, and misaligned tables; split by punctuation and layout while preserving original offsets for traceability.
- Entity recognition. Identify person names, organization names, addresses, and ID numbers, and build an alias table (abbreviations, full names, historical names).
- Relation extraction. Extract four-tuples of “shareholder, contribution, target company, ratio”, keeping both the original wording and the normalized value for the ratio.
- Normalization and disambiguation. Different entities with the same name, and the same entity written differently, must be merged. A joint decision based on “name similarity + registration location + fragments of the unified social credit code” is recommended.
A simplified example of an extraction result:
{"source": "Announcement, page 3","shareholder": "Entity A","target": "Entity C","ratio": 0.35,"raw_text": "holds 35% equity","confidence": 0.91}
Records with confidence below the threshold should not go straight into the graph; they should enter a manual review queue. This is the most economical way to control overall accuracy.
4. Graph Model Design and Storage Selection
With nodes in the hundreds of thousands and edges in the millions, multi-level self-joins in a relational database degrade quickly. Workable options:
- Adjacency list storage: a single
edge(from_id, to_id, ratio, meta)table supports most queries, with indexes on(from_id)and(to_id). - Graph databases: a better fit when variable-depth traversal or community detection is required.
- Cache layer: materialize penetration results for hot entities, attach a version number, and invalidate everything when the data is updated.
Example table definition:
CREATE TABLE equity_edge (from_id BIGINT NOT NULL,to_id BIGINT NOT NULL,ratio DECIMAL(9,6) NOT NULL,source_ref VARCHAR(255),updated_at TIMESTAMP,PRIMARY KEY (from_id, to_id),KEY idx_to (to_id));
5. Implementation Notes for the Penetration Algorithm
Recursive traversal must explicitly handle three kinds of boundary cases; otherwise infinite loops or drifting results are easy to hit in production.
def penetrate(graph, start, tau=0.01, max_depth=12):"""Return the accumulated equity of start in every terminal node"""result = defaultdict(float)stack = [(start, 1.0, 0, frozenset([start]))]while stack:node, weight, depth, visited = stack.pop()if depth >= max_depth or weight < tau:continueouts = graph.out_edges(node)if not outs:result[node] += weightcontinuefor nxt, ratio in outs:if nxt in visited: # circular holding: truncate and recordresult.setdefault('__cycle__', 0.0)continuestack.append((nxt, weight * ratio, depth + 1, visited | {nxt}))return dict(result)
Key points:
- The pruning threshold
taucontrols both precision and performance, typically 0.1% to 1%. - The depth limit prevents path explosion caused by abnormal data.
- Circular holdings must not simply be discarded; they should be flagged separately, because they are themselves an important risk signal.
- Results must retain path details; a final percentage alone cannot support an audit.
6. Common Pitfalls and Definitional Governance
- Mixed ratio semantics: subscribed versus paid-in, and direct versus indirect holdings, must be listed separately.
- Missing time dimension: equity changes frequently, so edge attributes should carry an effective interval and queries should slice by point in time.
- Alias drift: failing to merge historical renamings splits one entity into multiple nodes.
- Concerted actors: looking at equity alone misses contractual control, so non-equity edge types need to be introduced with lower confidence weights.
7. Production Architecture on the Cloud
A reusable layered architecture: an ingestion layer handles multi-source collection and deduplication; an extraction layer provides dual channels for batch inference and manual review; a storage layer keeps raw documents in object storage and structured edges in a relational or graph database; a compute layer runs scheduled full penetration plus incremental updates; a service layer outputs penetration results together with the evidence chain. Monitoring and alerting cover extraction failure rate, graph change volume, and query latency; a logging service retains full-chain call records for troubleshooting. General-purpose capabilities such as object storage, container platforms, logging, and monitoring and alerting from Baidu AI Cloud can carry these layers without binding to proprietary interfaces.
8. Validation and Quality Evaluation
Build an annotated dataset and evaluate in layers: precision and recall for entity recognition, exact match rate of four-tuples for relation extraction, and deviation from manual calculations for penetration results. After launch, keep sampling for review and feed low-confidence samples back as training data to close the loop. For key conclusions, always output the evidence chain with the source document and location annotated, so that conclusions are auditable and reproducible.
