Interactive semantic pedestrian trajectory prediction method based on language model and reinforcement learning

By using a language model and reinforcement learning approach, a trajectory prediction model with explicit interactive semantics is constructed, which solves the problems of transparency and accuracy bias in existing methods, and achieves high-precision, interpretable trajectory prediction, thereby improving the safety and decision-making capabilities of autonomous driving systems.

CN122022033APending Publication Date: 2026-05-12CHANGZHOU UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHANGZHOU UNIV
Filing Date
2026-01-23
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing trajectory prediction methods lack transparency and interpretability in complex and ever-changing interactive scenarios, and the prediction results deviate from the evaluation metrics, making it difficult to achieve high accuracy and compliance in a coordinated optimization.

Method used

We employ a language model-based and reinforcement learning approach to generate structured natural language prompts by calculating physical measures of spatiotemporal relationships between pedestrians. We then perform fully supervised fine-tuning and introduce a low-rank adaptive parameter module. Combined with a proximal policy optimization algorithm and a task reward function, we optimize the trajectory prediction model.

Benefits of technology

It significantly improves the interpretability of prediction results and the ability to model interactive semantics, achieving high-precision trajectory prediction that conforms to physical scene constraints, thereby enhancing the safety and decision-making capabilities of autonomous driving systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122022033A_ABST
    Figure CN122022033A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of pedestrian trajectory prediction, in particular to an interactive semantic pedestrian trajectory prediction method based on a language model and reinforcement learning. Comprising the following steps: calculating a physical measure for quantifying a space-time relationship between pedestrians based on a multi-pedestrian trajectory coordinate sequence; according to physical measurement, the interaction relation between each target pedestrian and the adjacent pedestrian is judged, and historical observation track coordinates of the target pedestrians and interaction relation description are jointly converted into natural language prompts; taking the language model as a basic model, taking a natural language prompt as input, taking a corresponding future trajectory coordinate text as a training target, and performing all-parameter supervision fine tuning to obtain a supervision fine tuning model; on the basis of the supervised fine tuning model, backbone network parameters are frozen, and a low-rank adaptive parameter module is introduced and trained; and a near-end strategy optimization algorithm is adopted, a programmable task award function is used for optimization, and a prediction model is obtained. According to the method, high-precision and explainable pedestrian trajectory prediction meeting physical scene constraints can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of pedestrian trajectory prediction technology, specifically to an interactive semantic pedestrian trajectory prediction method based on language models and reinforcement learning. Background Technology

[0002] Trajectory prediction aims to predict an individual's future trajectory by analyzing their historical movement patterns. This technology plays a crucial role in autonomous systems such as autonomous driving, behavior analysis, and robot path planning.

[0003] Existing prediction methods can be broadly categorized into two types: physics-based models and data-driven models. While physics-based methods offer some interpretability, they struggle to handle the complex and ever-changing interaction scenarios in the real world. With the development of deep learning technology, data-driven methods have become the mainstream paradigm in this field. Researchers widely employ architectures such as recurrent neural networks, graph neural networks, and attention mechanisms to model the temporal characteristics of pedestrian movement and social interactions. Furthermore, to capture the inherent randomness of pedestrian movement, multimodal generative models such as generative adversarial networks and conditional variational autoencoders have been introduced to predict diverse future trajectories. Although deep learning methods have made significant progress in prediction accuracy, their inherent "black box" nature leads to a lack of transparency and interpretability in the prediction results, limiting their reliable application in safety-critical scenarios such as autonomous driving.

[0004] In recent years, language models have demonstrated powerful capabilities in numerous sequence generation and reasoning tasks, and their natural language-based output formats have provided new avenues for addressing interpretability issues. Researchers have begun exploring the application of language models to trajectory prediction tasks, by textualizing trajectory coordinate sequences and leveraging the contextual understanding and generation capabilities of language models for prediction.

[0005] However, existing methods mostly only perform simple serialization of trajectory coordinates, failing to explicitly model the interaction semantics between pedestrians. Furthermore, there is a discrepancy between their training objectives (such as cross-entropy loss) and the final evaluation metrics for trajectory prediction (such as ADE / FDE), resulting in room for improvement in prediction accuracy and scene compliance. Therefore, there is an urgent need for a new trajectory prediction method that can deeply integrate interaction semantics, align prediction objectives, and combine high accuracy with interpretability.

[0006] Therefore, it is urgent to solve the above-mentioned technical problems in order to achieve both accuracy and interpretability. Summary of the Invention

[0007] The technical problem to be solved by the present invention is to overcome the defects of the prior art and provide an interactive semantic pedestrian trajectory prediction method based on language model and reinforcement learning, which can achieve high-precision, interpretable and physical scene-constrained pedestrian trajectory prediction.

[0008] To address the aforementioned technical problems, the technical solution of this invention is: an interactive semantic pedestrian trajectory prediction method based on language models and reinforcement learning, comprising:

[0009] Based on the multi-pedestrian trajectory coordinate sequence, a physical metric is calculated to quantify the spatiotemporal relationship between pedestrians; based on the physical metric, the interaction relationship between each target pedestrian and its neighboring pedestrians is determined, and the historical observation trajectory coordinates of the target pedestrian and the description of the interaction relationship are converted into structured natural language prompts.

[0010] Using a language model with an encoder-decoder architecture as the base model, natural language prompts as input, and the corresponding future trajectory coordinate text as the training target, supervised fine-tuning of all parameters is performed to obtain a supervised fine-tuned model.

[0011] Based on the supervised fine-tuning model, its backbone network parameters are frozen, and a low-rank adaptive parameter module is introduced and trained. The proximal policy optimization algorithm is used to optimize the supervised fine-tuning model with a programmable task reward function to obtain the prediction model.

[0012] The natural language prompts of the pedestrian to be predicted are input into the prediction model to generate a text sequence describing the future trajectory. The parser then extracts the coordinate sequence from the text sequence describing the future trajectory as the final pedestrian trajectory prediction.

[0013] Furthermore, physical metrics include relative distance, heading angle, and relative azimuth angle.

[0014] Furthermore, the types of interaction relationships include companionship, following, and obstacle.

[0015] Furthermore, the language model is the T5-small language model.

[0016] Furthermore, during the supervised fine-tuning training of the base model with all parameters, cross-entropy loss is used as the optimization objective.

[0017] Furthermore, the task reward function is configured to comprehensively calculate the negative average displacement error between the trajectory and the true value, as well as the penalty for out-of-bounds coordinate points based on the semantic mask of the binary scene.

[0018] Furthermore, the task reward function formula is as follows:

[0019] ;

[0020] ;

[0021] ;

[0022] In the formula, This represents the task reward function; and Indicates weight; The function represents the binary mask value of the location of the trajectory point; T represents the time step; Indicates generated text The coordinate sequence obtained by analysis; Represents the actual trajectory.

[0023] The present invention also relates to an apparatus comprising:

[0024] Memory, used to store computer programs;

[0025] A processor for executing the computer program, wherein the computer program, when executed by the processor, implements the steps of an interactive semantic pedestrian trajectory prediction method based on language models and reinforcement learning.

[0026] The present invention also relates to a readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of an interactive semantic pedestrian trajectory prediction method based on language models and reinforcement learning.

[0027] The present invention also relates to a computer program product, comprising a computer program that, when executed by a processor, implements the steps of an interactive semantic pedestrian trajectory prediction method based on language models and reinforcement learning.

[0028] By adopting the above technical solution, the present invention has the following beneficial effects:

[0029] (1) Significantly enhances the interpretability and interactive semantic modeling capability of prediction results: Unlike traditional "black box" deep learning models, this invention reconstructs the trajectory prediction task into an interpretable natural language generation task by constructing textual prompts containing explicit interactive semantics. The language model infers and generates based on these semantics, and its output natural language trajectory description and implicit decision logic provide an intuitive and human-understandable explanation for the prediction results, greatly improving the transparency and credibility of the model.

[0030] (2) Effectively solves the target mismatch problem and achieves synergistic optimization of accuracy and compliance: This invention innovatively adopts a two-stage training paradigm of "supervised fine-tuning + reinforcement learning". The supervised fine-tuning stage ensures that the model masters the correct text format and generation ability; the reinforcement learning stage directly optimizes the geometric accuracy and physical compliance of the predicted trajectory by integrating a composite reward function that combines the average displacement error reward and the scene out-of-bounds penalty. This mechanism fundamentally overcomes the target bias between optimizing text likelihood and optimizing trajectory indicators in traditional language modeling methods, thereby improving prediction accuracy while ensuring that the trajectory conforms to the constraints of the real scene.

[0031] (3) Enhancing the safety and decision-making capabilities of downstream intelligent systems: The high-precision, interpretable pedestrian trajectories generated by this invention, which conform to scene constraints, can provide more reliable environmental perception and future state projection results for autonomous driving systems, mobile robots, etc. This helps to improve the forward-looking planning quality, collision risk prediction accuracy, and final decision safety of such systems, and is of great value to promoting the application of related technologies in real and complex environments. Attached Figure Description

[0032] Figure 1 The flowchart shows the interactive semantic pedestrian trajectory prediction method based on language model and reinforcement learning of the present invention.

[0033] Figure 2 This is a framework diagram of the interactive semantic pedestrian trajectory prediction method based on language model and reinforcement learning of the present invention;

[0034] Figure 3 This is a qualitative analysis diagram of the SFT model of the present invention;

[0035] Figure 4 This is a qualitative analysis diagram of the RL model of the present invention. Detailed Implementation

[0036] To make the content of this invention easier to understand, the invention will be further described in detail below with reference to specific embodiments and accompanying drawings.

[0037] Example 1

[0038] like Figure 1 and Figure 2 As shown, an interactive semantic pedestrian trajectory prediction method based on language models and reinforcement learning includes:

[0039] Based on the multi-pedestrian trajectory coordinate sequence, a physical metric is calculated to quantify the spatiotemporal relationship between pedestrians; based on the physical metric, the interaction relationship between each target pedestrian and its neighboring pedestrians is determined, and the historical observation trajectory coordinates of the target pedestrian and the description of the interaction relationship are converted into structured natural language prompts.

[0040] Using a language model with an encoder-decoder architecture as the base model, natural language prompts as input, and the corresponding future trajectory coordinate text as the training target, supervised fine-tuning of all parameters is performed to obtain a supervised fine-tuned model.

[0041] Based on the supervised fine-tuning model, its backbone network parameters are frozen, and a low-rank adaptive parameter module is introduced and trained. The proximal policy optimization algorithm is used to optimize the supervised fine-tuning model with a programmable task reward function to obtain the prediction model.

[0042] The natural language prompts of the pedestrian to be predicted are input into the prediction model to generate a text sequence describing the future trajectory. The parser then extracts the coordinate sequence from the text sequence describing the future trajectory as the final pedestrian trajectory prediction.

[0043] The following detailed description of the solution involved in this embodiment, with reference to specific examples, is provided below.

[0044] like Figure 1 and Figure 2 As shown, a pedestrian trajectory prediction method based on language models and reinforcement learning includes:

[0045] Step S1 involves constructing a textualized pedestrian trajectory prediction dataset. This step aims to transform the original numerical trajectory data into semantically rich, structurally consistent, and parsable natural language descriptions to fully activate the prior knowledge of the pre-trained language model. The specific implementation includes the following three core steps:

[0046] Step S11, Trajectory Data Preprocessing and Interaction Feature Calculation: For the target pedestrian and all its neighboring pedestrians in a given scene, firstly, extract their coordinate sequences within historical observation frames. Based on these coordinates, calculate a series of interpretable physical metrics to quantify the spatiotemporal relationships between pedestrians. These physical metrics mainly include: relative distance (characterizing the spatial proximity between pedestrians), heading angle (describing the individual's own direction of movement), and relative azimuth angle (characterizing the orientation of neighboring pedestrians relative to the target pedestrian's direction of movement). All calculations are derived based on the geometric relationships of the coordinates, ensuring their physical meaning is clear.

[0047] Step S12, rule-based automatic semantic determination of interactions: Design a rule engine (or interaction module) to automatically label the relationship between the target pedestrian and each neighboring pedestrian based on the physical metrics calculated in step S11. The determination logic revolves around the following three core interaction types:

[0048] Accompanying: This is activated when the target and a nearby pedestrian maintain a close distance and move in a highly consistent direction during the observation period, corresponding to the side-by-side walking mode in reality.

[0049] Follow: This is activated when a nearby pedestrian is within a specific distance and orientation range in front of the target pedestrian, and both are moving in the same direction. It corresponds to the behavior pattern of following the leader.

[0050] Obstacles: Activated when a nearby pedestrian is detected rapidly approaching the target, or when the pedestrian is stationary very close to the target path, corresponding to conflict situations that require avoidance or detour.

[0051] Interactions that fail to meet any of the above semantic judgment conditions will be considered irrelevant or unknown and will not be included in the subsequent prompt construction, thereby ensuring the conciseness and relevance of the input information.

[0052] Step S13, Structured Natural Language Prompt Generation: Convert the above numerical information and semantic tags into a strict text format and embed them into a preset template.

[0053] Coordinate textification: Format all floating-point coordinate values ​​into decimal numeric strings that retain fixed precision, and organize them in chronological order into a sequence of text such as [(x1, y1), (x2, y2), ...].

[0054] The prompt template is filled in using a fixed three-part template: "Question-Context-Answer". In the "Context", the historical trajectory text of the target pedestrian is incorporated in sequence, as well as the trajectory of each neighboring pedestrian who is determined to have clear semantics and a description of their relationship (e.g., "Pedestrian 1 is an obstacle to pedestrian 0, and its trajectory is [...]").

[0055] Parsability Guarantee: By strictly uniform punctuation (such as parentheses and commas), keywords and sentence structure, it is ensured that the generated final prompt text can be losslessly reversed back into coordinate data and semantic labels by a deterministic parser (such as one based on regular expressions), providing a reliable foundation for subsequent model training and evaluation.

[0056] Step S2, Supervised Fine-Tuning Language Model Training: This step aims to train a language model to generate strictly formatted, directly parsable future trajectory text based on structured historical trajectories and interactive semantic cues. The core of this training phase is fully parameter-supervised fine-tuning, which includes the following key steps:

[0057] Task Formalization and Model Preparation: First, the pedestrian trajectory prediction task is explicitly defined as a conditional text generation task. The model input (x) is the complete prompt text constructed in step S1, containing both the "question" and "context"; the model output (y) is the corresponding "answer" text describing the future trajectory coordinates. A pre-trained language model with an encoder-decoder architecture (such as T5-Small) is selected as the base model, and its parameters will be fully updated at this stage.

[0058] Training Objective and Loss Function: A sequence-to-sequence training paradigm is adopted, using cross-entropy loss as the optimization objective. The core objective is to minimize the difference between the text sequence predicted by the model and the actual answer text sequence. Specifically, given an input cue x and a target output sequence s = (s1, s2, ..., s...), the training objective is to minimize the difference between the predicted text sequence and the actual answer text sequence. len ), len This represents the total number of tokens output. The loss function is defined as:

[0059]

[0060] This goal-driven model learns to autoregressively generate the probability distribution of the next correct token given the history and interaction context, thereby learning to reproduce the correct coordinate numbers, punctuation, and fixed template structure.

[0061] Format control and parsability assurance: A key objective of supervised fine-tuning is to ensure that the text output by the model strictly adheres to a predefined format. To this end, the "answer" portion of the training data is uniformly formatted as [(x1, y1), (x2, y2), ...,(x12, y12)]. By training on the full dataset, the model is forced to learn this precise grammatical and structural constraint, thereby reliably generating standardized text that can be losslessly processed by subsequent steps (such as a parser), laying the foundation for evaluation and reinforcement learning optimization.

[0062] Training Output and Stage Goals: After completing this stage of training, the model (referred to as the SFT model) possesses the basic ability to generate formatted trajectory text from text prompts. At this point, the model's optimization objective remains the language modeling likelihood at the text level, and it is not yet directly aligned with the ultimate geometric accuracy metrics for trajectory prediction (such as ADE / FDE). The core outcome of this stage is to obtain a model that "correctly answers question formats," providing a stable and parsable initialization strategy for the next stage of precise behavior alignment based on reinforcement learning.

[0063] Step S3, Policy Alignment Optimization Based on Reinforcement Learning: This step introduces reinforcement learning techniques on top of the supervised fine-tuning model to directly optimize non-differentiable performance metrics and physical constraints directly related to the trajectory prediction task, thus solving the "target mismatch" problem existing in the supervised fine-tuning stage. The core is to use a proximal policy optimization algorithm to optimize a composite procedural reward function. The specific implementation includes the following key steps:

[0064] Policy initialization and efficient parameter setting: The SFT model trained in step S2 is used as the initial policy (referred to as the reference policy). To preserve the language generation and format control capabilities acquired during the supervised fine-tuning phase, all parameters of the backbone language model are frozen at this stage. A low-rank adaptive parameter module is introduced, and only these few newly added adapter parameters are trained, thereby achieving efficient and stable policy optimization of the parameters.

[0065] Programmable reward function design: Design a scalar reward function Used to quantify the model's response to a given prompt. Generate response text The quality of the model is determined by two core components that guide its optimization towards "accuracy and compliance."

[0066] Track accuracy bonus: will generate text Parsing into a coordinate sequence Then, calculate its correlation with the actual trajectory. The negative average displacement error between them. This part of the direct excitation model reduces the predicted geometric error, and the formula is: .

[0067] Scene compliance penalty: Utilize the scene's binary semantic mask (e.g., 1 represents an unwalkable area, 0 represents a walkable area) to examine each coordinate point of the predicted trajectory. Whether the area falls into a violation zone and cumulative penalties are applied. This part forces the model to learn and comply with the physical constraints of the scene, as shown in the formula: ,in, The function represents the binary mask value of the location of the trajectory point; T represents the time step.

[0068] The total reward is the sum of the two: By adjusting the weights and This allows for a balance between preferences for accuracy and security.

[0069] Among these methods, a procedural reward function that integrates trajectory accuracy rewards and scenario compliance penalties is used to optimize the model for policy alignment, thereby simultaneously improving the geometric accuracy and physical plausibility of the predicted trajectory. Specifically, by designing a procedural reward function that includes negative ADE terms and out-of-bounds penalty terms based on binary semantic masks, prior knowledge such as maps and road structures can be incorporated as hard constraints into the model optimization process. This strengthens the physical constraints of the scenario, enabling the generated trajectory to proactively avoid entering infeasible areas, significantly reducing the physical irrationality of the predicted trajectory, and enhancing the reliability of its application in safety-critical scenarios such as autonomous driving.

[0070] Policy optimization and training stability assurance: The PPO algorithm is used to optimize the policy. In each iteration, the model generates text based on the current policy and calculates the total reward using the aforementioned reward function. To ensure that the policy update does not deviate drastically from the already well-formatted SFT model, adjustments to the current policy are introduced during the optimization process. Reference Strategy Constraining the KL divergence between the two is used to stabilize training and maintain the resolvability of the output. Ultimately, by maximizing the expected reward while constraining the KL divergence, the model parameters (LoRA adapter) are driven to update in the direction of generating trajectory text with higher accuracy and lower violation rate.

[0071] Phase Goal Achieved: Upon completion of this phase of training, the final optimized policy model is obtained. This model not only inherits the format control and parsability of the supervised fine-tuning model, but more importantly, its behavior in generating trajectory text has been directly aligned with the geometric accuracy target and scene safety constraints of trajectory prediction. This marks the evolution of the model from a "grammatically correct text generator" to an "intelligent agent that understands precise walking rules and abides by scene traffic regulations."

[0072] Step S4, Trajectory Generation, Parsing, and Final Output: This step applies the trained model to actual predictions and converts the natural language text generated by the model into structured trajectory data that can be directly used in downstream systems. This is an end-to-end inference and post-processing process, and its implementation includes the following key steps:

[0073] Input Preparation and Trajectory Text Generation: For a new scene to be predicted, the process in step S1 is followed first to convert the historical observation coordinates of the target pedestrian and surrounding pedestrians into structured text prompts. These prompts are then input into the final model trained and optimized in steps S2 and S3. Using these prompts as conditions, the model autoregressively generates a sequence of natural language text describing the future trajectory. This text is formatted strictly identically to the "answer" section in the training data.

[0074] Deterministic Text Parsing: Since the model output strictly follows a predefined template, a lightweight, deterministic parser (such as one based on regular expressions or simple grammar rules) can be used to process the generated text. This parser can accurately locate and extract the numeric strings representing future coordinates from the text, and convert these strings sequentially into two-dimensional coordinates (x, y) in floating-point format, thereby reconstructing a machine-readable sequence of trajectory coordinates. This process ensures a lossless and reliable conversion from interpretable text to computable numerical results.

[0075] Output Results and Optional Integrity Checks: The parsed coordinate sequence is packaged into a preset data structure (such as an array, list, or a specific protocol format) as the final pedestrian prediction trajectory output. To ensure the reliability of the output results, lightweight plausibility checks can be integrated at this step, such as verifying whether the number of trajectory points meets expectations and whether the coordinate values ​​are within the scene space range, to intercept the very few abnormal outputs that may be caused by model "illusions" and ensure the robustness of the system interface.

[0076] Process Closed Loop and Application: This completes the entire process from raw observation data to the final predicted trajectory. The generated trajectory data can be seamlessly transferred to downstream applications such as the planning module of autonomous vehicles, robot navigation systems, or behavior analysis platforms, providing them with high-precision, interpretable decision-making data that conforms to physical scene constraints, thereby realizing the closed-loop value of the technical solution.

[0077] This embodiment constructs a two-stage training framework of "supervised fine-tuning + reinforcement learning". This framework couples the language model with the trajectory prediction task by designing standardized text prompt templates and parsing interfaces. This modular design gives the method "plug-and-play" flexibility, allowing for easy adaptation to different pre-trained language model backbones without changing their core architecture or making large-scale adjustments to the training process, significantly reducing deployment and adaptation costs. The core advantage of this method lies in its systematic solution to the challenges of target mismatch and constraint integration faced by language models in trajectory prediction tasks through a two-stage training paradigm. First, supervised fine-tuning is performed by constructing a textual dataset containing explicit interactive semantics such as "accompanying," "following," and "obstacles," enabling the model to acquire the ability to describe and reason about trajectories based on natural language, fundamentally improving the transparency of the prediction process and the interpretability of the results. Furthermore, by introducing a reinforcement learning stage that integrates trajectory accuracy rewards and scene compliance penalties, the geometric accuracy and physical plausibility of the predicted trajectory are directly optimized, thereby significantly improving prediction accuracy while maintaining interpretability. This improvement transforms trajectory prediction output from a difficult-to-trace numerical sequence into an understandable semantic context (e.g., the model can generate avoidance trajectories based on the semantics of "pedestrian obstacle ahead"). This provides intelligent driving systems with more reliable decision-making support, enhancing user trust in autonomous driving technology and improving driving safety from the source by ensuring scenario compliance of trajectories. This is of great significance for promoting the reliable application of autonomous driving in complex and dynamic environments.

[0078] The following experiments will verify the solution involved in this embodiment.

[0079] 1. Dataset

[0080] To ensure a fair comparison of the frameworks proposed in the above embodiments, this experiment strictly follows the pedestrian trajectory prediction benchmark, using ETH / UCY and SDD as evaluation datasets.

[0081] 2. Evaluation Indicators

[0082] To evaluate the model's generalization ability and practical application performance, this experiment followed the standard training-validation-test split strategy and adopted a leave-one-out training method, i.e., training the model on four subsets and testing it on the remaining subsets. The diversity and complexity of this dataset provided a rigorous testing environment for the model's performance in handling diverse social interaction scenarios.

[0083] In the experiment, common evaluation metrics, including average displacement error (ADE) and final displacement error (FDE), were used to quantify the model’s accuracy performance at different time steps and prediction endpoints.

[0084] 3. Ablation Research

[0085] To systematically verify the effectiveness and necessity of the various core modules proposed in this invention, we conducted comprehensive ablation experiments on standard datasets.

[0086] The role of supervised fine-tuning and interactive semantics: First, the necessity of supervised fine-tuning and structured interactive semantic injection was evaluated. Experiments used an untuned pre-trained T5-small model as the initial baseline, which was completely unable to generate grammatically and formally correct trajectory text, achieving an effective parsing rate of 0%. After fully supervised fine-tuning, the SFT model achieved nearly 100% format effectiveness.

[0087] Furthermore, compared to the SFT* model which is fine-tuned only on coordinate sequence text, the SFT model trained with explicit interaction semantics including "accompanying / following / obstacles" significantly improves prediction accuracy. As shown in Table 1, on the ETH / UCY dataset (which has five subsets: ETH, HOTEL, UNIV, ZARA1, and ZARA2, with AVG representing the average), introducing interaction semantics reduces the average ADE and FDE by 4.5% and 6.3%, respectively, demonstrating that this design can effectively activate the prior knowledge of the language model and improve its ability to model social interactions.

[0088] Table 1: Research on supervised fine-tuning and interaction semantic ablation, where the SFT* model is the model with supervised fine-tuning on a dataset without interaction semantics, and the SFT model is the model with supervised fine-tuning on a dataset containing interaction semantics.

[0089] Model ETH HOTEL UNIV ZARA1 ZARA2 AVG SFT* model 0.41 / 0.51 0.12 / 0.16 0.22 / 0.34 0.20 / 0.32 0.17 / 0.27 0.22 / 0.32 SFT model 0.37 / 0.44 0.12 / 0.16 0.21 / 0.33 0.19 / 0.31 0.17 / 0.27 0.21 / 0.30 relative improvement -9.8% / -13.7% 0.0% / 0.0% -4.5% / -2.9% -5.0% / -3.1% 0.0% / 0.0% -4.5% / -6.3%

[0090] The role of the reinforcement learning alignment stage: To verify the contribution of the reinforcement learning stage to optimizing the final prediction target, we compared the SFT model that only underwent supervised fine-tuning with the RL model that underwent full two-stage training. Experimental results show that, while maintaining a highly stable output format, the reinforcement learning stage brings further performance optimization.

[0091] As shown in Table 2, the average ADE and FDE of the RL model on the ETH / UCY dataset were further reduced by 0% and 3.3% respectively compared to the SFT model. Meanwhile, by introducing scenario compliance rewards, the "off-path rate" of the predicted trajectory was significantly reduced by 21.7%. This quantitatively demonstrates that the reinforcement learning stage effectively solves the problem of target mismatch in supervised fine-tuning, achieving synergistic optimization of accuracy and compliance.

[0092] Table 2: Ablation study of the alignment stage of reinforcement learning, where the SFT model is the model fine-tuned under supervision on a dataset containing interactive semantics, and the RL model is the model after reinforcement learning alignment.

[0093] Model ETH HOTEL UNIV ZARA1 ZARA2 AVG SFT model 0.37 / 0.44 0.12 / 0.16 0.21 / 0.33 0.19 / 0.31 0.17 / 0.27 0.21 / 0.30 RL Model 0.35 / 0.41 0.12 / 0.15 0.20 / 0.32 0.19 / 0.29 0.17 / 0.26 0.21 / 0.29 relative improvement -5.4% / -6.8% 0.0% / -6.2% -4.8% / -3.0% 0.0% / -6.5% 0.0% / -3.7% -0.0% / -3.3%

[0094] 4. Quantitative analysis

[0095] To comprehensively evaluate the overall performance of this invention, we conducted a full comparison of the final model with current mainstream methods on public datasets.

[0096] As shown in Table 3, the proposed method achieves an average performance of 0.21 / 0.29 (ADE / FDE) on the ETH / UCY dataset and 7.42 / 10.13 on the more challenging SDD dataset. Compared with existing language model-based prediction methods, this method achieves a significant lead in accuracy. Furthermore, compared with state-of-the-art deep learning-based prediction models, the proposed method maintains competitive prediction accuracy while offering the unique advantages of providing natural language interpretation and strict adherence to scene constraints.

[0097] Table 3: Quantitative Analysis Table

[0098] .

[0099] 5. Qualitative Analysis

[0100] To visually demonstrate the ability of the method of this invention to model social interactions and comply with scenario constraints, we conducted a detailed qualitative analysis and visual comparison.

[0101] 5.1 Visualization of the Predictive Effect of Interactive Semantic Enhancement

[0102] We qualitatively evaluate the role of interactive semantics by comparing the prediction results of the SFT model trained with interactive semantics with those of the SFT* model trained without interactive semantics. Figure 3 As shown, in the three typical scenarios, the SFT model can generate trajectories that are more consistent with real-world social behavior:

[0103] Obstacle avoidance scenario: When there is a pedestrian in front of the target pedestrian who is judged as an "obstacle", the trajectory predicted by the SFT model (highlighted in yellow in the figure) shows an active deflection and avoidance behavior; while the trajectory predicted by the SFT* model tends to move forward in a straight line, ignoring potential conflicts.

[0104] In a following scenario: when there is a pedestrian being followed in front, the SFT model can generate a following trajectory that is in the same direction and maintains a stable distance; while the trajectory of the SFT* model gradually deviates and fails to maintain a stable following relationship.

[0105] In the case of companionship: For pedestrians identified as "companions", the SFT model can generate almost parallel cooperative walking trajectories; while the SFT* model generates multiple divergent paths and fails to capture the social attributes of walking together.

[0106] These visual examples corroborate the quantitative analysis findings, demonstrating that injecting explicit interactive semantics through text prompts enables models to more accurately understand and simulate complex social interactions among pedestrians.

[0107] 5.2 Visualization of Scenario Compliance After Reinforcement Learning Alignment

[0108] We further compared the differences in scene compliance of the generated trajectories between the supervised fine-tuned SFT model and the final RL model aligned through reinforcement learning. For example... Figure 4 As shown:

[0109] In some complex scenarios, the SFT model's predicted trajectory (highlighted in orange in the figure) may extend into non-driveable areas such as sidewalks and lawns, or run close to the road boundary, exhibiting a high risk of "off-tracking".

[0110] In contrast, the predicted trajectories of the RL model strictly adhere to the boundaries of feasible regions in multiple scenarios, significantly reducing the occurrence of trajectory points encroaching on drivable areas.

[0111] These qualitative results directly demonstrate the effectiveness of the scenario compliance reward introduced during the reinforcement learning phase. By optimizing this non-differentiable objective, the model learns to treat the physical structure of the scenario as a hard constraint, thereby generating reasonable trajectories that are not only more accurate but also significantly safer.

[0112] Example 2

[0113] A device characterized in that,

[0114] include:

[0115] Memory, used to store computer programs;

[0116] A processor is configured to execute the computer program, which, when executed by the processor, implements the steps of the interactive semantic pedestrian trajectory prediction method based on language model and reinforcement learning as described in Embodiment 1.

[0117] Example 3

[0118] A readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the interactive semantic pedestrian trajectory prediction method based on language model and reinforcement learning as described in Embodiment 1.

[0119] Example 4

[0120] A computer program product includes a computer program that, when executed by a processor, implements the steps of the interactive semantic pedestrian trajectory prediction method based on language model and reinforcement learning as described in Embodiment 1.

[0121] Based on the above-described preferred embodiments of the present invention, and through the foregoing description, those skilled in the art can make various changes and modifications without departing from the inventive concept. The technical scope of this invention is not limited to the contents of the specification, but must be determined according to the scope of the claims.

Claims

1. A method for predicting pedestrian trajectories based on language models and reinforcement learning, characterized in that, include: Based on the multi-pedestrian trajectory coordinate sequence, a physical metric is calculated to quantify the spatiotemporal relationship between pedestrians; based on the physical metric, the interaction relationship between each target pedestrian and its neighboring pedestrians is determined, and the historical observation trajectory coordinates of the target pedestrian and the description of the interaction relationship are converted into structured natural language prompts. Using a language model with an encoder-decoder architecture as the base model, natural language prompts as input, and the corresponding future trajectory coordinate text as the training target, supervised fine-tuning of all parameters is performed to obtain a supervised fine-tuned model. Based on the supervised fine-tuning model, its backbone network parameters are frozen, and a low-rank adaptive parameter module is introduced and trained. The proximal policy optimization algorithm is used to optimize the supervised fine-tuning model with a programmable task reward function to obtain the prediction model. The natural language prompts of the pedestrian to be predicted are input into the prediction model to generate a text sequence describing the future trajectory. The parser then extracts the coordinate sequence from the text sequence describing the future trajectory as the final pedestrian trajectory prediction.

2. The interactive semantic pedestrian trajectory prediction method based on language model and reinforcement learning according to claim 1, characterized in that, Physical measurements include relative distance, heading angle, and relative azimuth angle.

3. The interactive semantic pedestrian trajectory prediction method based on language model and reinforcement learning according to claim 1, characterized in that, Types of interaction relationships include companionship, following, and obstacle.

4. The interactive semantic pedestrian trajectory prediction method based on language model and reinforcement learning according to claim 1, characterized in that, The language model is the T5-small language model.

5. The interactive semantic pedestrian trajectory prediction method based on language model and reinforcement learning according to claim 1, characterized in that, During the fully supervised fine-tuning training of the base model, cross-entropy loss is used as the optimization objective.

6. The interactive semantic pedestrian trajectory prediction method based on language model and reinforcement learning according to claim 1, characterized in that, The task reward function is configured to comprehensively calculate the negative average displacement error between the trajectory and the true value, as well as the out-of-bounds coordinate point penalty based on the binary scene semantic mask.

7. The method for predicting pedestrian trajectories based on language models and reinforcement learning according to claim 6, characterized in that, The formula for the task reward function is: ; ; ; In the formula, This represents the task reward function; and Indicates weight; The function represents the binary mask value used to check the location of the trajectory point; T represents the time step; Indicates generated text The coordinate sequence obtained by analysis; Represents the actual trajectory.

8. A device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program, wherein the computer program, when executed by the processor, implements the steps of the interactive semantic pedestrian trajectory prediction method based on language model and reinforcement learning as described in any one of claims 1-7.

9. A readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the interactive semantic pedestrian trajectory prediction method based on language model and reinforcement learning as described in any one of claims 1-7.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the interactive semantic pedestrian trajectory prediction method based on language model and reinforcement learning as described in any one of claims 1-7.