LLM-Based Intelligent Analysis Platform for Government Petition Services: Implementation Lessons

    This article examines the real-world deployment of an LLM-powered intelligent analysis and decision-support platform built for government petition (public complaint) services. It explains the three structural challenges the platform targets, a three-layer architecture that decouples the model, knowledge bases, and application scenarios, and a four-step knowledge engineering workflow that often determines the system's effectiveness more than the model itself. The article also breaks down core scenarios such as assisted registration, legal classification, procedure matching, document review, and risk analysis, and covers security, compliance, and evaluation practices. Readers will find a practical, human-in-the-loop methodology for piloting similar systems in restricted or offline environments.

    1. Where the Problem Starts: Three Structural Tensions in Petition Handling

    Government petition work has long faced three kinds of tension.

    The first is standardization pressure. Requests arrive through scattered channels: service windows, hotlines, letters, and online portals. Missing registration fields and inconsistent terminology force staff to repeatedly request corrections during later processing.

    The second is classification difficulty. The same type of request may fall under different statutory channels. Acceptance, transfer, assignment, and review each have their own applicable conditions. Manual judgment relies heavily on experience, making consistent standards hard to enforce.

    The third is delayed risk identification. Disputes often show early warning signs, but the information exists as unstructured text, which makes trend aggregation and early alerts difficult.

    A prefecture-level petition department built an intelligent analysis and decision-support platform in 2025 to address these three tensions. The core idea is not to replace people with a model, but to combine the language understanding and reasoning capabilities of a large language model with a structured body of business knowledge. The result is “intelligent assistance under knowledge constraints.”

    2. Overall Architecture: Decoupling Model, Knowledge, and Scenarios

    A reusable architecture should decouple three layers so that business logic is not hard-coded into prompts.

    • Model layer: A distilled open-source LLM (commonly a 32B-class distilled model in the industry) deployed privately on a government network. This keeps data within its domain and allows offline inference.
    • Knowledge layer: Multiple topic-specific knowledge bases, including a business standardization base, a rule-of-law knowledge base, an item database, a list of powers and responsibilities, a statutory classification base, a laws and regulations base, and a review and re-review workflow base. Each is supported by dual channels: vector retrieval and full-text search.
    • Scenario layer: Designed around a “full-chain, full-process, all-around” approach, with six major application scenarios, more than ten topic bases, and over twenty specific functions covering registration, screening, procedure matching, document review, and risk analysis.

    The key benefit of this layering is that the model can be replaced, knowledge can be operated and maintained, and scenarios can be extended. Updating knowledge does not require retraining the model, and adding scenarios does not require changing the underlying layers.

    3. Knowledge Base Engineering: The Real Bottleneck for Quality

    In practice, poor results are usually not a model capability problem but a knowledge supply problem. A four-step build process is recommended:

    1. Corpus governance: Deduplicate scattered regulatory documents, lists of powers and responsibilities, and historical cases; add version labels and expiration markers; and clearly define the boundary of what is “currently in effect.”
    2. Chunking and annotation: Split content by clause or item rather than by a fixed character count. Preserve metadata such as clause numbers and effective dates to support citation and traceability.
    3. Dual-channel retrieval: Vector retrieval handles semantic similarity, while keyword retrieval handles exact matches such as statute numbers and item names. The results are then fused and reranked.
    4. Evaluation set construction: Sample from real historical cases to build a labeled evaluation set that covers easily confused categories. This serves as a regression baseline for every knowledge update.

    A schematic retrieval and constraint workflow can be expressed as:

    1. def classify_petition(text, kb):
    2. # 1. Dual-channel recall
    3. cand = kb.hybrid_search(text, top_k=20)
    4. # 2. Keep only currently effective clauses
    5. cand = [c for c in cand if c.valid and c.effective_date <= TODAY]
    6. # 3. The model decides only within the candidate set; free generation of legal basis is prohibited
    7. result = llm.infer(
    8. prompt=CLASSIFY_PROMPT,
    9. context=render(cand),
    10. schema=CLASSIFY_SCHEMA, # structured output constraint
    11. )
    12. # 4. Route low-confidence cases to human review
    13. return result if result.confidence >= TH else to_human(result)

    The key design points here are “deciding only within the candidate set” and “structured output constraints.” Together, they significantly reduce the probability that the model fabricates a legal basis.

    4. Core Scenario Breakdown

    • Assisted registration: Extract elements such as the petitioner, the respondent, the factual description, and the request type from raw text. Proactively ask about missing items to form a standardized work order.
    • Nature screening and statutory classification: Based on the classification knowledge base and the list of powers and responsibilities, output a suggested category, statutory channel, and supporting clauses, along with a confidence score.
    • Procedure matching and correction: Apply rule-based checks to the applicable conditions for acceptance, transfer, assignment, and review. Flag procedural mismatches immediately.
    • Document review: Check the completeness of four elements: facts, legal basis, conclusion, and remedy notification. Mark missing items and wording risks.
    • Risk analysis: Aggregate items across multiple dimensions (region, domain, subject, and time), identify duplicate and concentrated trends, and output risk alerts rather than conclusive judgments.
    • Knowledge Q&A and training: Provide frontline staff with answers that include sources, shortening the onboarding time for newcomers.

    5. Security and Compliance: Private Deployment Is Only the Start

    Private deployment solves “data stays within its domain,” but it does not mean compliance is complete. Additional measures are needed: end-to-end audit trails that record model inputs, outputs, and cited sources; tiered permissions with minimum necessary access; masking of sensitive fields before they enter the inference pipeline; human review as the final step, with model output serving only as a suggestion; and protection against prompt injection and unauthorized Q&A, supported by red-team testing.

    6. Effect Evaluation: Replace Subjective Impressions with Verifiable Metrics

    A three-tier metric system is recommended: an efficiency tier (registration time, number of corrections), a quality tier (on-time acceptance rate, statutory classification accuracy, first-pass document approval rate), and a risk tier (alert lead time, reduction in repeat visits). Each tier should retain a human-labeled baseline and undergo quarterly regression evaluation to avoid a situation where performance peaks at launch and then declines.

    7. A Transferable Methodology

    This practice was recommended by a higher-level authority in the form of a special report and was followed by on-site research. Four transferable lessons stand out. First, choose scenarios that are high-frequency, clearly rule-based, and tolerant of controlled errors. Second, decouple knowledge from the model and focus operational effort on knowledge governance. Third, keep humans in the loop: the model only makes suggestions and does not make decisions. Fourth, complete private deployment validation on a government network first, then expand scenarios gradually. For organizations that are just starting, it is advisable to run a small-scale pilot with two or three high-frequency scenarios, quantify the benefits with an evaluation set, and then replicate horizontally.