A tax difference automatic adjustment method based on knowledge distillation

By employing an automatic adjustment method based on knowledge distillation, utilizing BiLSTM-CRF sequence labeling and PPO reinforcement learning models, tax and accounting differences are automatically identified and optimized. This addresses the omission risks and inefficiencies of manual adjustments, achieving efficient, accurate, and compliant tax adjustments, thereby reducing corporate tax risks and labor costs.

CN121998784BActive Publication Date: 2026-07-07CHINASOFT CLOUD ENTERPRISE INFORMATION SERVICES (NANJING) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINASOFT CLOUD ENTERPRISE INFORMATION SERVICES (NANJING) CO LTD
Filing Date
2026-04-09
Publication Date
2026-07-07

AI Technical Summary

Technical Problem

The current method of adjusting tax and accounting differences relies on manual methods, which has problems such as high risk of omission, low efficiency, limited accuracy and poor consistency. In addition, the high professional competence required of tax personnel leads to increased tax declaration errors and tax risks.

Method used

An automatic adjustment method based on knowledge distillation is adopted. Accounting entry data is collected through an interface, BiLSTM-CRF sequence labeling model is used to identify the difference type, and the adjustment result is calculated by simulating the tax law expert rule base in combination with the knowledge distillation model. Finally, the adjustment strategy is optimized through PPO reinforcement learning model to generate the optimal adjustment plan.

Benefits of technology

It has achieved automated identification and adjustment of tax and accounting differences, with an accuracy rate of over 95%, an efficiency increase of 95%, and a compliance rate of 99%. Under the premise of compliance, it has optimized and reduced the tax burden of enterprises, significantly reducing labor costs and tax risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121998784B_ABST
    Figure CN121998784B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of tax and accounting data processing, and specifically provides a tax and accounting difference automatic adjustment method based on knowledge distillation, which comprises the following steps: connecting an enterprise financial system through an interface, collecting accounting entry data, and converting the data into structured data; inputting the data into a pre-trained sequence labeling model to identify accounting entries that need to be adjusted for tax and accounting differences and their corresponding difference types; inputting the data into a knowledge distillation model to calculate and output preliminary tax adjustment results; inputting the data into an adjustment strategy optimization model to generate an optimal adjustment plan; and converting the optimal adjustment plan into standard tax adjustment entries and declaration supplementary table data according to the declaration form format specifications of the tax system. Through the above scheme, the technical problems of high omission risk, low efficiency, limited accuracy, and poor consistency in the existing tax and accounting difference manual adjustment technology are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of tax and accounting data processing technology, and specifically provides a method for automatically adjusting tax and accounting differences based on knowledge distillation. Background Technology

[0002] Currently, adjustments for the difference between accounting profit and taxable income primarily rely on manual methods. First, finance personnel must collect all accounting vouchers, ledger records, and related tax-related documents for the current period, including but not limited to various accounting entries and original vouchers for revenue, cost, and expense categories. Second, finance personnel must be proficient in the provisions regarding tax-accounting differences in the *Accounting Standards for Business Enterprises*, the *Enterprise Income Tax Law of the People's Republic of China*, and related regulations, comparing over 200 known discrepancies, such as business entertainment expenses, asset depreciation, employee welfare expenses, and R&D expense deductions, to verify the differences between accounting treatment and tax law requirements. Finally, based on the verification results, the adjustment amount for taxable income is calculated, and tax adjustment entries and related schedules for the tax return are manually prepared. However, the existing manual adjustment method has several drawbacks.

[0003] With over 200 tax-accounting discrepancies, and some of these discrepancies being hidden (e.g., differences in the timing of revenue recognition for certain special business transactions, or differences between the accrual and pre-tax deduction of asset impairment provisions), manual verification can easily lead to omissions due to human error. This can result in errors in tax returns, increasing the company's tax risks and the likelihood of subsequent tax audits, back taxes, and penalties.

[0004] Manual processing requires finance personnel to spend a lot of time sorting out vouchers, comparing regulations, and calculating adjustment amounts. Especially for larger companies with complex business operations, the difference adjustment work before each tax declaration often requires several finance personnel to spend several days to complete, which seriously affects the efficiency of tax declaration.

[0005] Adjustments for tax-accounting differences involve complex interpretations of tax laws and the integration of accounting treatments, demanding a high level of professional competence from finance personnel. Novice finance personnel are prone to making adjustments due to a lack of thorough understanding of tax laws or unfamiliarity with specific business differences; even experienced finance personnel may experience errors in the accuracy of adjustments due to factors such as fatigue and subjective judgment bias.

[0006] When different finance personnel handle the same type of tax-accounting differences, they may adopt different adjustment logics and calculation methods due to different understandings, resulting in inconsistent adjustment results. At the same time, key steps such as verification and calculation in the manual adjustment process lack clear record traces, making it difficult to quickly trace the basis for adjustment when tax disputes arise later. Summary of the Invention

[0007] In order to overcome the above-mentioned defects, this invention is proposed to provide a solution to, or at least partially solve, the technical problems of high omission risk, low efficiency, limited accuracy and poor consistency of existing manual adjustment techniques for tax and accounting differences.

[0008] This invention provides a method for automatically adjusting tax and accounting differences based on knowledge distillation, comprising the following steps:

[0009] S1: Connect to the enterprise's financial system through an interface to collect accounting entry data, and clean and standardize the accounting entry data to transform it into structured data;

[0010] S2: Input structured data into a pre-trained sequence labeling model to identify accounting entries that require tax and accounting difference adjustments, along with their corresponding difference types and confidence levels, and output them as a JSON array.

[0011] S3: Input the identified accounting entries, difference types, and confidence levels into the knowledge distillation model to calculate and output preliminary tax adjustment results;

[0012] S4: Input the preliminary tax adjustment results and the company's operating status data into the adjustment strategy optimization model to generate the optimal adjustment plan;

[0013] S5: Convert the optimal adjustment scheme into standard tax adjustment entries and supplementary tax schedule data according to the tax system's declaration form format specifications.

[0014] Furthermore, the accounting entry data includes core fields such as account code, account name, amount, occurrence time, business type, and voucher ID.

[0015] Furthermore, in S1, it connects to the enterprise's financial system through real-time interfaces or batch interfaces. Real-time interfaces include RESTful API and JDBC direct connection, while batch interfaces include file transfer protocol and standard financial data exchange protocol.

[0016] Furthermore, the collected original accounting entry data is cleaned, including deduplication, formatting error correction, and outlier handling.

[0017] Data cleansing involves retaining the first record and deleting subsequent duplicates if the account code, account name, amount, transaction time, business type, and voucher ID are completely identical within the same accounting period.

[0018] The formatting corrections include converting dates that are not in YYYY-MM-DD format to YYYY-MM-DD format, extracting pure numbers and retaining two decimal places for amounts containing non-numeric characters, and extracting pure numbers for account codes containing letters / special symbols.

[0019] Outlier handling includes cases where the amount is negative but the business type is "revenue". These cases are marked as outliers and prompted for manual review. For cases where the occurrence time exceeds the current accounting period, cross-period data is automatically removed and logged.

[0020] Furthermore, step S2 includes,

[0021] S21: Constructing a sequence labeling model based on BiLSTM network and CRF layer;

[0022] S22: Construct a training set of labeled samples, with the labeling results being "needs adjustment - difference type" or "no adjustment required". Input the training set into the BiLSTM network, capture the contextual association information of the accounting entry sequence through bidirectional propagation, learn the constraint relationship between labels through the CRF layer, and optimize the sequence labeling model parameters through backpropagation.

[0023] S23: The structured data is decomposed into four-dimensional feature vectors of "subject code-amount-business type-occurrence time" and input into the sequence labeling model for training. The subject code is converted into numerical features using one-hot encoding, the amount is normalized, and the business type and occurrence time are converted into vector representations using word embedding technology. The sequence labeling model outputs the labeling results corresponding to each accounting entry.

[0024] Furthermore, step S3 includes,

[0025] S31: A teacher model is built around a tax law expert rule base. Tax law rules are transformed into structured logical judgment modules. After inputting accounting entry data, the teacher model can output accurate adjustment direction, adjustment ratio and adjustment amount.

[0026] S32: Construct a lightweight convolutional neural network as a student model;

[0027] S33: Input the training samples into the teacher model and student model for distillation training. The output of the teacher model is used as the "soft label" and the actual tax adjustment result is used as the "hard label". The trained student model is used as the knowledge distillation model.

[0028] Furthermore, step S31 includes,

[0029] S311: By reviewing official documents, we can obtain the tax rules regarding the adjustment of tax and accounting differences, which are divided into five categories: "income, cost, expense, asset, and special business".

[0030] S312: Using the quadruple decomposition method, each tax law rule is transformed into {trigger condition, adjustment logic, output result, exception handling};

[0031] S313: Based on the Drools framework, build a rule base and store the decomposed tax law rules in the rule base based on the Drools framework.

[0032] Furthermore, in the distillation training, a distillation loss function incorporating tax compliance constraints is constructed. ,in,

[0033] The cross-entropy loss between the student model and the hard labels, C represents the total number of categories, and N represents the batch size. Let the one-hot value of the true label of the nth sample in category i be _____. Let i be the probability that the student model predicts the nth sample as class i.

[0034] The KL divergence loss for soft labels in the student and teacher models. , The temperature parameter is used for the softening probability distribution. For the softmax function, / These are the unnormalized outputs of the teacher / student models, respectively.

[0035] This is a tax compliance constraint item. K represents the number of tax compliance items to be checked. Let k be the weight coefficient of the rule. Let α be the penalty function for the k-th rule, and β be the weight coefficients, where α ∈ [0.2, 0.4] and β ∈ [0.3, 0.7].

[0036] Furthermore, step S4 includes,

[0037] S41: Define the tax and accounting difference adjustment scenario as the environment, and define the adjustment strategy optimization module as the intelligent agent. The intelligent agent's actions include adjusting the amount allocation and adjusting the timing selection.

[0038] S42: The reward function of the adjusted strategy optimization model consists of two parts: dynamic compliance reward and tax burden optimization reward. The reward function formula is as follows: ,in, This indicates a dynamic compliance reward. This indicates a tax burden optimization incentive. =0.7, =0.3. If the adjustment result complies with tax law, a positive dynamic compliance reward will be obtained. If the tax burden of the enterprise is lower than the benchmark value after adjustment and is within the compliance range, a positive tax burden optimization reward will be obtained. The reward amount is positively correlated with the tax burden reduction. If a compliance issue occurs, a negative reward will be obtained.

[0039] S43: By continuously interacting with the environment, the network parameters of the policy optimization model are constantly updated and adjusted to maximize the cumulative reward. After training, the adjusted policy optimization model can output the optimal adjustment strategy according to the actual situation of different enterprises.

[0040] Furthermore, step S41 includes,

[0041] S411: Define a 6-dimensional standardized state space to represent enterprise operational status data;

[0042] S412: Design discrete and continuous actions. Discrete actions include the R&D expense deduction ratio and depreciation method selection to adapt to discrete options allowed by policy. Continuous actions include the annual amortization ratio of accelerated depreciation of fixed assets to adapt to flexible adjustment needs.

[0043] S413: Design the policy network and the value network. The policy network takes a 6-dimensional state space vector as input and outputs a discrete action probability distribution and a continuous action value. It is responsible for generating and adjusting the policy. The value network takes a 6-dimensional state space vector as input and outputs a state value. It is responsible for evaluating the quality of the current policy.

[0044] The working principle and beneficial effects of this invention:

[0045] In implementing the technical solution of this invention, a three-level collaborative architecture of "identification-adjustment-optimization" is constructed. First, a sequence labeling model is used to automatically identify the accounting entries requiring adjustment and the types of differences from the enterprise's financial system. Then, a knowledge distillation model is used to simulate the calculation of preliminary adjustment results from a tax law expert rule base. Finally, a strategy optimization model is introduced to minimize the tax burden while ensuring compliance, generating the optimal adjustment plan and automatically converting it into standard tax return data. This effectively solves the problems of high omission risk and low efficiency associated with manual adjustments, improving the adjustment accuracy to over 95% while increasing efficiency by 95%, and optimizing and reducing the enterprise's tax burden while ensuring 100% compliance, significantly reducing the enterprise's labor costs and tax risks. Attached Figure Description

[0046] The disclosure of this invention will become more readily understood with reference to the accompanying drawings. It will be readily understood by those skilled in the art that these drawings are for illustrative purposes only and are not intended to limit the scope of protection of this invention. Furthermore, similar numbers in the drawings are used to denote similar components, wherein:

[0047] Figure 1 This is a schematic diagram of the main steps of the automatic adjustment method for tax and accounting differences based on knowledge distillation according to the present invention.

[0048] Figure 2This is a structural principle block diagram of an automatic adjustment method for tax and accounting differences based on knowledge distillation according to the present invention;

[0049] Figure 3 This is a schematic diagram of the model architecture of the student model in this invention;

[0050] Figure 4 This is a schematic diagram of the data flow of an automatic adjustment method for tax and accounting differences based on knowledge distillation according to the present invention. Detailed Implementation

[0051] Some embodiments of the present invention will now be described with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are merely illustrative of the technical principles of the present invention and are not intended to limit the scope of protection of the present invention.

[0052] Figure 1 This is a schematic diagram of the main steps of an automatic adjustment method for tax and accounting differences based on knowledge distillation according to the present invention. Figure 2 This is a structural principle block diagram of an automatic adjustment method for tax and accounting differences based on knowledge distillation, according to the present invention. Figures 1-2 As shown, the automatic adjustment method for tax and accounting differences based on knowledge distillation in this embodiment mainly includes the following steps S1 and S5.

[0053] Step S1: Data collection and preprocessing. By connecting to the enterprise's financial system through an interface, accounting entry data (including core fields such as account code, account name, amount, occurrence time, business type, and voucher ID) is collected. The accounting entry data is then cleaned (removing duplicate data and correcting format errors) and standardized (unifying account codes and classifying business types) and transformed into structured data.

[0054] In one implementation, the system interfaces with enterprise financial systems (such as ERP systems) through multi-protocol adapters to collect voucher data for accounting periods in real-time or in batches. Real-time interfaces include RESTful APIs (supporting GET / POST requests with JSON response) and direct JDBC connections (compatible with databases such as MySQL, Oracle, and SQL Server). Batch interfaces include file transfer protocols (SFTP / FTP) and standard financial data exchange protocols (OFX2.2, FINS3.0). All interfaces use HTTPS encrypted transmission, employ dual authentication via API key + dynamic token, and add a checksum (MD5) during data transmission to prevent tampering.

[0055] In one implementation, cleaning the collected raw accounting entry data includes deduplication, formatting error correction, and outlier handling. Specifically,

[0056] Duplicate data cleaning: For records with identical account codes, account names, amounts, occurrence times, business types, and voucher IDs within the same accounting period, retain the first record and delete subsequent duplicates.

[0057] Formatting error correction: For dates not in YYYY-MM-DD format, convert them to YYYY-MM-DD format; for amounts containing non-numeric characters (such as "1,200.00 yuan" or "two thousand yuan"), extract the pure numbers and retain two decimal places; for account codes containing letters / special symbols, extract the pure numbers.

[0058] Outlier handling: If the amount is negative but the business type is "revenue" (which should be positive), mark it as an outlier and prompt for manual review; for data that occurs outside the current accounting period, automatically remove cross-period data and record it in the log.

[0059] In one implementation, the collected raw accounting entry data is standardized by converting the enterprise's custom account codes into standard account codes recognized by the tax system based on a preset "enterprise self-compiled account - standard account" mapping table (as shown in Table 1), and finally transforming the raw accounting entry data into structured data that the model can read.

[0060] Table 1:

[0061]

[0062] Step S2: Input the structured data into the pre-trained sequence labeling model to identify the accounting entries that need to be adjusted for tax and accounting differences, as well as their corresponding difference types and confidence levels, and output them in the form of a JSON array.

[0063] In this embodiment, to address the issue of easy omissions in manual identification of tax and accounting differences, a BiLSTM-CRF (Bidirectional Long Short-Term Memory Network-Conditional Random Field) sequence labeling model is adopted to automatically identify the accounting entries requiring adjustment and their corresponding difference types. The processing procedure of the sequence labeling model is as follows:

[0064] S21: Construct a sequence labeling model based on the CRF layer of a BiLSTM network.

[0065] Structured data is decomposed into four-dimensional feature vectors of "account code - amount - business type - occurrence time" as input to the sequence labeling model. The account code is converted into numerical features using one-hot encoding, the amount is normalized, and the business type and occurrence time are converted into vector representations using word embedding technology. Finally, the vectors are concatenated to form the feature representation of each accounting entry.

[0066] S22: Construct a training set containing 100,000 labeled samples (the samples cover common discrepancies such as business entertainment expenses, asset depreciation, and R&D expenses, and the labeling results are "needs adjustment - discrepancy type" or "no adjustment required"). Input the samples into the BiLSTM network, capture the contextual information of the accounting entry sequence through bidirectional propagation, and then learn the constraint relationship between labels through the CRF layer (such as the "asset depreciation" discrepancy item only corresponding to a specific asset class account). Optimize the sequence labeling model parameters through backpropagation so that the sequence labeling model can achieve an accuracy of over 95%.

[0067] S23: Decompose the structured data into four-dimensional feature vectors of "account code-amount-business type-occurrence period" and input them into the sequence labeling model after training. The sequence labeling model outputs the labeling results corresponding to each accounting entry, such as "adjustment required - business entertainment expenses", "adjustment required - fixed asset depreciation", and "no adjustment required".

[0068] In one implementation, the structural parameters of the sequence labeling model built based on the CRF layer of the BiLSTM network are shown in Table 2.

[0069] Table 2:

[0070]

[0071] Step S3: Input the identified accounting entries, difference types, and confidence levels into the knowledge distillation model, simulate the logic of the tax law expert rule base, calculate and output the preliminary tax adjustment results.

[0072] In this embodiment, the knowledge distillation model is a lightweight student model trained using knowledge distillation technology, based on a teacher model constructed from a tax law expert rule base. This improves operational efficiency while maintaining adjustment accuracy. The specific implementation process of the knowledge distillation model is as follows:

[0073] S31: Construct a teacher model centered on a tax law expert rule base. Transform tax law rules into structured logical judgment modules. After inputting relevant accounting entry data, the teacher model can output accurate adjustment direction, adjustment ratio, and adjustment amount.

[0074] S311: By reviewing official documents such as the Enterprise Income Tax Law and its implementing regulations, and announcements from the State Taxation Administration, we obtained the tax law rules regarding the adjustment of tax and accounting differences, which are divided into five categories: "income, cost, expense, asset, and special business".

[0075] S312: Using the quadruple decomposition method, each tax law rule is transformed into {trigger condition, adjustment logic, output result, exception handling}.

[0076] One implementation method is illustrated using the business entertainment expense rule as an example:

[0077] Triggering conditions: Account code = 660201 (Business entertainment expenses) and debit amount > 0, the enterprise is subject to tax collection upon audit;

[0078] Adjustment logic: Deductible amount = min (amount incurred × 60%, annual operating revenue × 0.5%), Adjustment amount = Amount incurred - Deductible amount;

[0079] Output: Adjustment direction (increase), adjustment amount, rule number (R001);

[0080] Exception handling: During the preparation period, 60% of the actual amount incurred by the enterprise shall be included in the preparation expenses, corresponding to sub-rule R001-1.

[0081] S313: Based on the Drools framework, a rule base is constructed, as shown in Table 3. The decomposed tax law rules are stored in the rule base based on the Drools framework. When accounting data is input, the inference engine in the rule base matches the rules and outputs the accurate adjustment direction and amount.

[0082] Table 3:

[0083]

[0084] S32: Construct a lightweight convolutional neural network (CNN) as a student model. Figure 3 This is a schematic diagram of the student model in this invention. For example... Figure 3 As shown, this model employs a depthwise separable convolutional structure, significantly reducing the number of parameters while maintaining adjustment accuracy. Its network layers are only 1 / 3 of traditional deep learning models, and the number of parameters is reduced by 70%, making it easy to deploy lightweightly on ordinary enterprise servers or in the cloud. Specifically:

[0085] The input layer receives a 1024-dimensional feature vector, which is formed by concatenating the subject features output by the sequence labeling model with the difference type encoding;

[0086] The first convolutional module includes convolutional layer 1 and pooling layer 1. Convolutional layer 1 uses 3×3 depthwise separable convolution, with 16 convolutional kernels configured and a stride of 1. After being processed by the ReLU activation function, it is input into a 2×2 max pooling layer for downsampling with a stride of 2.

[0087] The second convolutional module consists of convolutional layer 2 and pooling layer 2. Convolutional layer 2 also uses 3×3 depthwise separable convolution, with the number of convolutional kernels increased to 32 and the stride kept at 1. After ReLU activation, it is connected to a 2×2 average pooling layer for feature dimensionality reduction with a stride of 2.

[0088] The fully connected layer has 64 nodes and introduces a Dropout mechanism with a deactivation ratio of 0.2 to prevent model overfitting and improve generalization ability.

[0089] The output layer contains three nodes, which correspond to the three key output parameters of tax adjustment: adjustment direction (increase / decrease / no adjustment), adjustment ratio (such as expense deduction ratio), and adjustment amount, realizing end-to-end mapping from feature input to adjustment result.

[0090] S33: Input the training samples into the teacher model and student model for distillation training. The output of the teacher model (adjustment direction, adjustment ratio and adjustment amount) is used as "soft label", and the actual tax adjustment results (such as data recognized by the tax bureau) are used as "hard label". The trained student model is used as the knowledge distillation model.

[0091] In this embodiment, through training with a large number of samples, the student model learns the decision-making logic of the teacher model. Ultimately, the student model achieves 98% of the teacher model's adjustment accuracy, while the inference speed is increased by 3 times.

[0092] In the distillation training, a distillation loss function incorporating tax compliance constraints is constructed. The formula for calculating the loss function is as follows: ,in, The cross-entropy loss between the student model and the hard labels, C represents the total number of categories, and N represents the batch size. Let the one-hot value of the true label of the nth sample in category i be _____. Let i be the probability that the student model predicts the nth sample as class i. The KL divergence loss for soft labels in the student and teacher models. , The temperature parameter is used for the softening probability distribution. Here, KL represents the softmax function, and KL represents the KL divergence between the teacher model and the student model. / These are the unnormalized outputs of the teacher / student models, respectively. This is a tax compliance constraint item. K represents the number of tax compliance items to be checked. The weighting coefficient for the k-th rule (set based on tax audit risk). Let α be the penalty function for the k-th rule. When the adjustment result violates tax regulations, this loss term increases significantly; α and β are weighting coefficients.

[0093] In this context, α ∈ [0.2, 0.4], with the optimal value being α = 0.3. Hard labels (actual adjustment results) account for 30% of the weight, while soft labels (teacher model output) account for 70%. This prioritizes ensuring that the student model inherits the expert rule logic of the teacher model. When the enterprise's business complexity is high (with many special difference items), α can be lowered to 0.2 to enhance the weight of soft labels; when sufficient historical adjustment data is available, it can be raised to 0.4 to enhance the weight of hard labels. β ∈ [0.3, 0.7], with the optimal value being β = 0.5. This provides a moderate weight for compliance constraints, avoiding both insufficient adjustment flexibility due to excessive constraints and compliance breaches. High-risk enterprises (such as high-tech enterprises and foreign trade enterprises) can raise β to 0.6-0.7 to strengthen compliance constraints; low-risk enterprises can lower it to 0.3-0.4 to increase the space for tax burden optimization.

[0094] Step S4: Input the preliminary tax adjustment results and the company's operating status data into the adjustment strategy optimization model (i.e., Figure 4 In the “PPO reinforcement learning model”, the adjustment strategy optimization model aims at dynamic compliance rewards and tax burden optimization rewards, and optimizes the initial adjustment results to generate the optimal adjustment plan.

[0095] In this embodiment, to achieve the goal of "minimizing tax burden while meeting compliance," a proximal policy optimization (PPO) reinforcement learning algorithm is used to construct an adjustment policy optimization model. The specific implementation process is as follows:

[0096] S41: Define the tax and accounting difference adjustment scenario as the environment, and the adjustment strategy optimization module as the agent. The agent's actions include adjusting the amount allocation and adjusting the timing selection. To solve the problem of unstable updates in traditional reinforcement learning strategies, the core is to build an "environment-agent" interaction framework.

[0097] S411: Define a 6-dimensional standardized state space to represent enterprise operating status data, as shown in Table 4. After the agent executes an adjustment action, the environmental state is updated in real time (e.g., after adjusting the R&D expense deduction ratio, the cumulative adjustment amount is updated synchronously).

[0098] Table 4:

[0099]

[0100] S412: Design discrete and continuous actions. Discrete actions include the R&D expense deduction ratio and depreciation method selection, to adapt to discrete options allowed by policy; continuous actions include the annual amortization ratio of accelerated depreciation of fixed assets, to adapt to flexible adjustment needs.

[0101] S413: Design the policy network and the value network. The policy network takes a 6-dimensional state space vector as input and outputs a discrete action probability distribution and a continuous action value. It is responsible for generating and adjusting the policy. The value network takes a 6-dimensional state space vector as input and outputs a state value. It is responsible for evaluating the quality of the current policy.

[0102] S42: The reward function of the adjusted strategy optimization model consists of two parts: dynamic compliance reward and tax burden optimization reward. The reward function formula is as follows: If the adjustment results comply with tax regulations (and pass verification by the teacher model), a positive dynamic compliance reward will be received; if the adjusted corporate tax burden is lower than the benchmark value (adjusted tax burden before optimization) and within the compliance range, a positive tax burden optimization reward will be received, with the reward amount positively correlated with the tax burden reduction; if compliance issues arise, a negative reward will be received. Through multiple rounds of verification, while emphasizing the principle of compliance first, among other things... This indicates a dynamic compliance reward. This indicates a tax burden optimization incentive. =0.7, The reward function works best when the value is 0.3.

[0103] in, Figure 4 The logic shows that the student model outputs compliance verification results, which is a rule-based pre-verification that provides a high-quality "initial state" for the reinforcement learning model. The reinforcement learning model's assessment of "final compliance" is a policy-oriented, dynamic compliance evaluation. Instead of simply reusing the initial identifiers output by the student model, the reward value is given by the environment (or an independent compliance verification module) after the agent explores a new action, based on the latest tax law rule base, after real-time and dynamic compliance judgment.

[0104] S43: The continuous interaction between the agent and the environment (simulating adjustment scenarios for different enterprises) is used to continuously update the network parameters of the adjustment strategy optimization model, maximizing cumulative rewards. After training, the adjustment strategy optimization model can output the optimal adjustment strategy for different enterprises' actual situations, minimizing tax burden while ensuring compliance. Specifically:

[0105] S431: The agent interacts with the environment and collects a quadruple of (state, action, reward, next state); the PPO algorithm is used to update the policy network, and the GAE is used to calculate the advantage function; a safety threshold is set to limit the policy update step size to prevent training instability; the course gradually transitions from simple enterprise scenarios to complex scenarios.

[0106] S432: Backtesting and verification were performed on data from 1,000 historical enterprises; the results were compared with those from manual adjustment schemes and expert systems; tax risks were assessed through Monte Carlo simulation, a large number of uncertain scenarios were randomly sampled and generated, the models were substituted into them to calculate the adjustment results, the proportion of non-compliant scenarios and risk distribution were statistically analyzed, and finally the compliance rate of the model was verified to meet the requirement of >99%.

[0107] S433: After more than 100,000 iterations, the adjustment strategy optimization model can output the optimal adjustment strategy for different companies based on their actual situations. Under the premise of ensuring compliance, the average tax burden of pilot companies is reduced by about 5%, while maintaining the interpretability and traceability of the adjustment plan.

[0108] In this embodiment, the sequence labeling model, knowledge distillation model, and adjustment strategy optimization model work collaboratively through a closed loop of "input-processing-feedback." The specific interaction process is as follows: the structured financial and tax data output from data preprocessing is first input into the sequence labeling model to identify "difference accounts (i.e., accounting entries) + difference types." The output of the sequence labeling model is passed to the knowledge distillation model (student model) in the form of "structured feature vectors," and simultaneously serves as one of the input features of the student model (supplementing the "difference type encoding" dimension). Based on the input features and the rule logic of the teacher model, the knowledge distillation model calculates the preliminary adjustment results (adjustment direction, amount, and proportion). The initial adjustment results are integrated with enterprise operating status data (operating scale, cost structure, etc.) to form a 6-dimensional state vector, which is input into the adjustment strategy optimization model. At the same time, the "adjustment amount allocation scheme" in the initial adjustment results serves as the "initial action suggestion" for the reinforcement learning agent. The adjustment strategy optimization model optimizes the adjustment strategy (such as correcting the R&D expense deduction ratio and adjusting the fixed asset depreciation amortization sequence) through "environment-agent" interaction, and outputs the "optimal strategy parameters". The optimal strategy parameters are fed back to the knowledge distillation model to correct its adjustment logic (such as recalculating the adjustment amount and optimizing the adjustment sequence), and finally generate the "compliant + tax burden optimal" adjustment result.

[0109] Step S5: Convert the optimal adjustment scheme into standard tax adjustment entries and tax return schedule data according to the tax system's declaration form format specifications, and support export or interface integration with the tax declaration system.

[0110] In one implementation, the declaration form conversion logic is based on the "Annual Corporate Income Tax Declaration Form" to achieve a precise mapping between the adjustment results and the declaration forms in the tax system.

[0111] Mapping rules: Adjustments output by the model are matched hierarchically according to "difference type → supplementary table of the declaration form → corresponding row number", for example:

[0112] Differences in business entertainment expenses → Appendix 3, "Detailed List of Tax Adjustment Items," line 15, "(III) Business Entertainment Expenses."

[0113] Fixed asset depreciation differences → Appendix 3, line 32, “(a) Asset depreciation and amortization”

[0114] Verification mechanism: Automatic verification is performed according to the logical relationship of "increase amount + decrease amount = book amount - tax amount" to ensure compliance with the declaration form filling rules.

[0115] In one implementation, the appropriate conversion of the application form for integration with the application system includes API interface integration and file export format.

[0116] API Interface Integration

[0117] Target audience: Open API of e-Tax Bureau

[0118] Interface Specifications: RESTful API, POST request method, request headers include Authorization and Content-Type (application / json).

[0119] Response mechanism: The application status (accepted / rejected) is returned synchronously. When rejected, the specific error code is returned (such as abnormal line data or mismatched check code).

[0120] File export format

[0121] Supported formats: CSV (comma-separated, UTF-8 encoding), XML (compliant with the "Taxation Electronic Data Interchange Standard" GB / T24589-2010)

[0122] Exported content includes: main application form + supplementary forms, verification file (.chk), and explanatory file (.txt).

[0123] Import requirements: The file naming convention is "Enterprise Credit Code-Report Form Number-Tax Year. Format Suffix" (e.g., 913100000000000000-A105000-2025.csv).

[0124] The key innovations of the knowledge distillation-based automatic adjustment method for tax and accounting differences, implemented based on steps S1-S5 above, are as follows:

[0125] (1) Integration of knowledge distillation and tax compliance constraints: The tax law expert rule base is innovatively transformed into a teacher model, and a lightweight student model is trained through knowledge distillation technology, which solves the problems of complex rules and difficult deployment of traditional expert systems. At the same time, a tax compliance constraint term is introduced into the distillation loss function to ensure that the output of the student model inherits the accuracy of the expert rules and meets the compliance requirements, laying the foundation for subsequent tax burden optimization.

[0126] (2) Three-level collaborative technical architecture of "identification-adjustment-optimization": A three-level collaborative architecture of BiLSTM-CRF sequence labeling model, knowledge distillation model and PPO reinforcement learning model was constructed, realizing the full-process automation of tax and accounting differences from "subject identification" to "amount calculation" and then to "strategy optimization" for the first time. Among them, the sequence labeling model solves the problem of "what to adjust", the knowledge distillation model solves the problem of "how to adjust", and the reinforcement learning model solves the problem of "how to optimize the adjustment". The three models perform their respective functions and cooperate with each other to form a complete technical closed loop.

[0127] (3) Tax burden optimization strategy model based on PPO algorithm: In view of the pain point that existing technologies cannot take into account both compliance and tax burden optimization, the PPO reinforcement learning algorithm is adopted. Enterprise operating data, difference information, etc. are used as state inputs and adjustment strategies are used as action outputs. A dual reward function containing compliance and tax burden optimization is designed so that the model can adapt to the actual scenarios of different enterprises, output the optimal adjustment strategy, and achieve the goal of "minimizing tax burden under the premise of compliance".

[0128] (4) High generalization of the difference account identification model: The BiLSTM-CRF sequence labeling model is used to process the accounting entry sequence. Through feature engineering and contextual association capture, the model can identify more than 200 different tax and accounting difference accounts, including common business entertainment expenses, asset depreciation and other difference items, as well as special business difference items with strong concealment. The generalization is much higher than the traditional rule matching-based identification method, and the identification accuracy reaches more than 95%.

[0129] This invention addresses many shortcomings of existing manual adjustments and traditional expert systems through a fusion of "sequence labeling + knowledge distillation + reinforcement learning" technology. Compared with existing technologies, it has the following significant advantages:

[0130] (1) Reduce labor costs: Enterprises do not need to employ multiple senior tax accountants to be responsible for the difference adjustment work. Only one ordinary financial staff member is needed to be responsible for system data connection and result review, which reduces labor costs by more than 60%.

[0131] (2) Significantly improved efficiency: The entire process of adjusting tax and accounting differences is automated, eliminating the need for manual verification of each difference item. Roughly estimated, for a company with an annual turnover of 100 million yuan, the manual adjustment would take at least a week to complete, while this invention can complete it in just two hours, improving efficiency by more than 95%. At the same time, the adoption of a lightweight student model increases the model inference speed several times, supporting the batch adjustment needs of large-scale enterprises.

[0132] (3) Significantly improved adjustment accuracy: The BiLSTM-CRF sequence labeling model achieves an accuracy of over 95% in identifying discrepancies, far exceeding the 75% accuracy of manual identification; the knowledge distillation model inherits the high-precision characteristics of tax law expert rules, achieving an adjustment calculation accuracy of 98%, effectively avoiding errors caused by negligence or lack of professionalism in manual adjustments; the reinforcement learning model further ensures the compliance of adjustment results through a compliance constraint mechanism, achieving a compliance rate of 99%.

[0133] (4) Achieving a balance between tax burden optimization and compliance: Existing technologies can only achieve "compliance adjustments" and cannot simultaneously optimize tax burden; this invention, through the PPO reinforcement learning model, can minimize the tax burden of enterprises while ensuring the compliance of the adjustment results. Tests have shown that after adopting the adjustment scheme of this invention, pilot enterprises experienced an average tax burden reduction of approximately 5% within the compliance scope, significantly improving their economic benefits.

[0134] (5) Scalability and consistency: When tax law provisions are updated, only the expert rules in the teacher model need to be updated, and the student model can be quickly updated through knowledge distillation. There is no need to reconstruct the entire system on a large scale, which is highly scalable. At the same time, the model is adjusted based on unified rules and algorithms, avoiding subjective differences in manual adjustment, ensuring that the adjustment results of different enterprises and different periods are highly consistent, and the basis for adjustment can be quickly located during subsequent tax tracing.

[0135] It should be noted that although the steps in the above embodiments are described in a specific order, those skilled in the art will understand that in order to achieve the effects of the present invention, different steps do not necessarily have to be executed in such an order. They can be executed simultaneously (in parallel) or in other orders, and these variations are all within the scope of protection of the present invention.

[0136] Example 2

[0137] Figure 4 This is a schematic diagram of the data flow in an automatic adjustment method for tax and accounting differences based on knowledge distillation, as described in this invention. Figure 4 As shown in the embodiment, the data flow of steps S1 to S5 in the automatic adjustment method for tax and accounting differences based on knowledge distillation is explained as follows:

[0138] 1. Unidirectional basic flow: Data layer → Sequence labeling model → Knowledge distillation model → Application layer → Tax declaration system, ensuring a smooth basic process of "identification-adjustment-transformation";

[0139] 2. Two-way feedback flow: Knowledge distillation model ↔ PPO reinforcement learning model, realizing a closed loop of "initial adjustment → strategy optimization → result correction", ensuring that the adjustment result is both compliant and optimal;

[0140] 3. Traceability data flow: The “related traceability information” (voucher ID, rule number, verification log) output by each model is synchronously stored in the database, forming a full-link traceability chain of “raw data - identification result - adjustment process - declaration result”.

[0141] Furthermore, the data flow is described in detail below:

[0142] 1. Sequence labeling model → Knowledge distillation model: Data flow format

[0143] {

[0144] "voucher_id":"V20240315001",

[0145] "subject_code":"660201",

[0146] "difference_type":"R001",

[0147] "confidence": 0.98

[0148] },

[0149] The difference_type corresponds one-to-one with the rule number of the teacher model, ensuring that the student model accurately matches the expert rules;

[0150] 2. Knowledge Distillation Model → PPO Reinforcement Learning Model: The data flow consists of two parts, one being the preliminary adjustment result (adjustment_preliminary).

[0151] {

[0152] "direction":"increase",

[0153] "amount":50000,

[0154] "rule_id":"R001",

[0155] "compliance":"PASS"

[0156] },

[0157] Second, the compliance verification result: compliance_detail

[0158] {

[0159] "risk_items":[],

[0160] "pass_rate": 1.0

[0161] };

[0162] 3. PPO Reinforcement Learning Model → Knowledge Distillation Model: Feedback data stream is optimization_params:

[0163] {

[0164] "rd_deduction_rate":0.75,

[0165] "depreciation_period":3,

[0166] "adjustment_timing":"Q4"

[0167] },

[0168] After receiving the knowledge distillation model, the adjustment amount is recalculated, and the adjustment result is verified to ensure compliance with requirements.

[0169] 4. All data streams are accompanied by unique identifiers and timestamps to ensure that they can be linked to original accounting documents, model parameters, and adjustment logic when traced later.

[0170] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after such changes or substitutions will all fall within the scope of protection of the present invention.

Claims

1. A method for automatically adjusting tax and accounting differences based on knowledge distillation, characterized in that, Includes the following steps: S1: Connect to the enterprise's financial system through an interface to collect accounting entry data, and clean and standardize the accounting entry data to transform it into structured data; S2: Input structured data into a pre-trained sequence labeling model to identify accounting entries that require tax and accounting difference adjustments, along with their corresponding difference types and confidence levels, and output them as a JSON array. S3: Input the identified accounting entries, difference types, and confidence levels into the knowledge distillation model to calculate and output preliminary tax adjustment results; S4: Input the preliminary tax adjustment results and the company's operating status data into the adjustment strategy optimization model to generate the optimal adjustment plan; S5: Convert the optimal adjustment scheme into standard tax adjustment entries and tax return schedule data according to the tax system's declaration form format specifications; The accounting entry data includes the core fields of account code, account name, amount, occurrence time, business type, and voucher ID; Step S2 includes, S21: Constructing a sequence labeling model based on BiLSTM network and CRF layer; S22: Construct a training set of labeled samples, with the labeling results being "needs adjustment - difference type" or "no adjustment required". Input the training set into the BiLSTM network, capture the contextual information of the accounting entry sequence through bidirectional propagation, learn the constraint relationship between labels through the CRF layer, and optimize the sequence labeling model parameters through backpropagation. S23: The structured data is decomposed into four-dimensional feature vectors of "subject code - amount - business type - occurrence time" and input into the sequence labeling model for training. The subject code is converted into numerical features using one-hot encoding, the amount is normalized, and the business type and occurrence time are converted into vector representations using word embedding technology. The sequence labeling model outputs the labeling results corresponding to each accounting entry. Step S3 includes: S31: A teacher model is built around a tax law expert rule base. Tax law rules are transformed into structured logical judgment modules. After inputting accounting entry data, the teacher model can output accurate adjustment direction, adjustment ratio and adjustment amount. S32: Construct a lightweight convolutional neural network as a student model; S33: Input the training samples into the teacher model and student model for distillation training. The output of the teacher model is used as the "soft label" and the actual tax adjustment result is used as the "hard label". The trained student model is used as the knowledge distillation model.

2. The method for automatic adjustment of tax and accounting differences based on knowledge distillation according to claim 1, characterized in that, In S1, it connects to the enterprise's financial system through real-time interfaces or batch interfaces. Real-time interfaces include RESTful API and JDBC direct connection, while batch interfaces include file transfer protocol and standard financial data exchange protocol.

3. The method for automatic adjustment of tax and accounting differences based on knowledge distillation according to claim 1, characterized in that, The collected raw accounting entry data is cleaned, including deduplication, formatting error correction and outlier handling. Data cleansing involves retaining the first record and deleting subsequent duplicates if the account code, account name, amount, transaction time, business type, and voucher ID are completely identical within the same accounting period. The formatting corrections include converting dates that are not in YYYY-MM-DD format to YYYY-MM-DD format, extracting pure numbers and retaining two decimal places for amounts containing non-numeric characters, and extracting pure numbers for account codes containing letters / special symbols. Outlier handling includes cases where the amount is negative but the business type is "revenue". These cases are marked as outliers and prompted for manual review. For cases where the occurrence time exceeds the current accounting period, cross-period data is automatically removed and logged.

4. The method for automatic adjustment of tax and accounting differences based on knowledge distillation according to claim 1, characterized in that, Step S31 includes, S311: By reviewing official documents, we can obtain the tax rules regarding the adjustment of tax and accounting differences, which are divided into five categories: "income, cost, expense, asset, and special business". S312: Using the quadruple decomposition method, each tax law rule is transformed into {trigger condition, adjustment logic, output result, exception handling}; S313: Based on the Drools framework, build a rule base and store the decomposed tax law rules in the rule base based on the Drools framework.

5. The method for automatic adjustment of tax and accounting differences based on knowledge distillation according to claim 1, characterized in that, In the distillation training, a distillation loss function incorporating tax compliance constraints is constructed. ,in, The cross-entropy loss between the student model and the hard labels, C represents the total number of categories, and N represents the batch size. Let the one-hot value of the true label of the nth sample in category i be _____. Let i be the probability that the student model predicts the nth sample as class i. The KL divergence loss for soft labels in the student and teacher models. , The temperature parameter is used for the softening probability distribution. For the softmax function, / These are the unnormalized outputs of the teacher / student models, respectively. This is a tax compliance constraint item. K represents the number of tax compliance items to be checked. Let k be the weight coefficient of the rule. Let α be the penalty function for the k-th rule, and β be the weight coefficients, where α ∈ [0.2, 0.4] and β ∈ [0.3, 0.7].

6. The method for automatic adjustment of tax and accounting differences based on knowledge distillation according to claim 1, characterized in that, Step S4 includes, S41: Define the tax and accounting difference adjustment scenario as the environment, and define the adjustment strategy optimization module as the intelligent agent. The intelligent agent's actions include adjusting the amount allocation and adjusting the timing selection. S42: The reward function of the adjusted strategy optimization model consists of two parts: dynamic compliance reward and tax burden optimization reward. The reward function formula is as follows: ,in, This indicates a dynamic compliance reward. This indicates a tax burden optimization incentive. =0.7, =0.

3. If the adjustment result complies with tax law, a positive dynamic compliance reward will be obtained. If the tax burden of the enterprise is lower than the benchmark value after adjustment and is within the compliance range, a positive tax burden optimization reward will be obtained. The reward amount is positively correlated with the tax burden reduction. If a compliance issue occurs, a negative reward will be obtained. S43: By continuously interacting with the environment, the network parameters of the policy optimization model are constantly updated and adjusted to maximize the cumulative reward. After training, the adjusted policy optimization model can output the optimal adjustment strategy according to the actual situation of different enterprises.

7. The method for automatic adjustment of tax and accounting differences based on knowledge distillation according to claim 6, characterized in that, Step S41 includes, S411: Define a 6-dimensional standardized state space to represent enterprise operational status data; S412: Design discrete and continuous actions. Discrete actions include the R&D expense deduction ratio and depreciation method selection to adapt to discrete options allowed by policy. Continuous actions include the annual amortization ratio of accelerated depreciation of fixed assets to adapt to flexible adjustment needs. S413: Design the policy network and the value network. The policy network takes a 6-dimensional state space vector as input and outputs a discrete action probability distribution and a continuous action value. It is responsible for generating and adjusting the policy. The value network takes a 6-dimensional state space vector as input and outputs a state value. It is responsible for evaluating the quality of the current policy.