Trajectory planning model training and inference method with timing waypoint encoding and preference adaptation

By adopting a trajectory planning model training method based on temporal waypoint encoding and preference adaptation, the problems of trajectory representation and multiple preference selection in autonomous driving are solved. This method achieves fine-grained controllable representation and supervision of geometric perception, thereby improving the planning efficiency and decision-making quality of autonomous driving.

CN123161189APending Publication Date: 2026-11-24SHANGHAI JIAOTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611500243.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-24
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

In existing technologies, trajectory planning models struggle to achieve fine-grained controllable representation of trajectories, supervision of geometric perception, and trajectory generation and selection under multiple preference conditions in autonomous driving, leading to wasted computing resources and insufficient decision-making.

Method used

A trajectory planning model training method based on temporal waypoint coding and preference adaptation is adopted. The visual language action model is trained by waypoint lexical sequences and geometric soft-label cross-entropy loss. Combined with multi-view driving images and navigation commands, fine-grained trajectory representation and trajectory generation and selection under multiple preference conditions are realized.

Benefits of technology

The unified model realizes fine-grained controllable representation of trajectories and supervision of geometric perception, which can generate and select reasonable driving decisions under multi-preference conditions, reduce computational latency and improve the planning performance of autonomous driving tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123161189A_ABST
    Figure CN123161189A_ABST
Patent Text Reader

Abstract

This application relates to trajectory planning for autonomous driving, providing a training and inference method for a trajectory planning model that combines temporal waypoint encoding and preference adaptation, comprising three stages: training preparation, training, and inference. In the training preparation stage, the expert's future N-step trajectory is encoded into waypoint lexical units with independent time and coordinate components, constructing scene description, planning inference, waypoint answers, and scene category supervision data. In the training stage, weighted sampling is performed according to motion category, and supervised fine-tuning is conducted using geometric soft-label cross-entropy and lexical weighted cross-entropy. Then, the same visual language action model is optimized using multi-preference trajectory rewards and process rewards. In the inference stage, the model determines the scene category; simple scenes generate a single structured trajectory planning result, while complex scenes generate multi-preference candidates which are selected by the model, and the target trajectory is decoded. This application unifies the model's scene understanding, trajectory representation, and preference post-training, and allocates candidate generation and comparison calculations according to scene complexity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of autonomous driving, machine learning and computer vision technology, specifically to a method for training and inference of a trajectory planning model based on temporal waypoint encoding and preference adaptation, an electronic device and a computer-readable storage medium. Background Technology

[0002] Visual language models can combine driving images and text commands to understand road scenes and generate driving decisions. When representing trajectories as ordinary numerical text, the values ​​may be split into multiple words, and the sequence length and parsing process are affected by word segmentation rules. Even using only the discretized correct words as the sole target, it is difficult to directly express the geometric proximity relationship between coordinates: predicting adjacent coordinates and predicting distant coordinates are both incorrect categories in hard-label supervision.

[0003] In the prior art, CN119283896A discloses a trajectory planning method for autonomous vehicles, which adopts an architecture that fuses end-to-end branching with visual language model branching. The visual language model branch predicts several different trajectory sequences, and then the outputs of the two branches are fused based on the loss value and the danger situation. However, in this scheme, there is still a separation at the representation level between the trajectory sequence and the visual language model output. The generation of multiple candidates relies on branch fusion rather than the conditionalization mechanism inside the model, and it does not involve geometric supervision at the trajectory lexicon level.

[0004] DIAL (Driving Intents Amplify Planning-Oriented Reinforcement Learning) discloses a two-stage reinforcement learning framework that expands the sampling distribution of flow-matched action heads through intent-conditional CFG and maintains diversity through multi-intent GRPO. This approach reveals the pattern collapse problem of continuous action policies under single-demonstration supervised fine-tuning: sampling results cluster around the demonstration action, and the policy cannot represent semantically different alternatives. However, DIAL's intent is a driving operation pattern, its action generation is based on autoregressive generation of flow-matched action heads rather than lexical sequences, and candidate selection relies on the learned intent classifier rather than a comparison mechanism within the same model.

[0005] Another type of visual language action scheme sets up a continuous action planner outside the visual language model, using visual language features or inference results as conditions to generate continuous trajectories through diffusion denoising or flow matching. For example, Alpamayo-R1 employs a structure connecting a visual language backbone with a flow-matching-based action expert. These methods can represent continuous trajectory distributions, but require managing the feature interface between language generation and action generation, and coordinating text supervision and continuous action supervision. When incorporating text inference and trajectories into word-level reinforcement learning, it is also necessary to design feedback and optimization paths suitable for different output representations.

[0006] Vehicle planning also involves different requirements such as risk, driving progress, and smoothness of motion. A single fixed preference is insufficient to reflect the trade-offs between multiple reasonable driving options; deploying multiple independent models for different preferences increases the need for parameter storage and maintenance. For simple scenarios, continuously generating and comparing multiple candidates increases computation; for complex interactive scenarios, generating only once may not be sufficient to compare different driving decisions.

[0007] Therefore, how to achieve fine-grained controllable representation of trajectories, geometrically aware supervision, and trajectory generation and selection under multiple preference conditions in a unified model has become a technical problem that needs to be solved. Summary of the Invention

[0008] In view of the above-mentioned problems or one of the problems existing in the prior art, this application provides a method for training and inference of trajectory planning model based on time-series waypoint encoding and preference adaptation.

[0009] The first aspect of this application provides a method for training a trajectory planning model based on temporal waypoint encoding and preference adaptation, including: Training preparation steps: Acquire multi-view driving images, vehicle speed, navigation commands, and corresponding expert future trajectories; encode the expert trajectories into waypoints at N future time steps with uniform time intervals, establish grid and lexical mapping, and obtain waypoint lexical sequences. Each waypoint lexical identifies its time step, coordinate components, and coordinate grid index; construct supervised data, which includes waypoint answers composed of the waypoint lexical sequences and category supervised data for simple or complex scenarios labeled by the teacher model; Supervised fine-tuning steps: Weighted sampling of training samples containing supervised data according to the motion category of the expert trajectory; constructing geometric soft labels with the expert trajectory as a reference; combining geometric soft label cross-entropy loss and waypoint lexical weighted cross-entropy loss to supervise and fine-tune the visual language action model; and using multi-view driving images, vehicle speed and navigation commands as inputs to train the scene judgment ability of the visual language action model with the category-supervised data. The reinforcement learning steps are as follows: Multiple structured trajectory planning results are sampled based on multi-view driving images, vehicle speed, navigation commands, and efficiency, safety, or comfort preferences. For each structured trajectory planning result, the trajectory reward and process reward corresponding to its preference conditions are calculated, and the shared parameters of the visual language action model are optimized and updated using a group-relative strategy. Sample feedback corresponding to different preferences jointly updates the same set of shared parameters. The structured trajectory planning results include at least waypoint answers.

[0010] A second aspect of this application provides a trajectory planning and reasoning method based on temporal waypoint encoding and preference adaptation. This method inputs current multi-view driving images, vehicle speed, and navigation commands into a visual language action model trained using the aforementioned method, and performs the following steps: Scene determination step: The model outputs a simple or complex scene category based on the current multi-view driving images, vehicle speed, and navigation instructions; Trajectory result generation steps: For simple scenarios, a single structured trajectory planning result is generated using preset preferences; for complex scenarios, while keeping the input multi-view driving images, vehicle speed, navigation commands, and model parameters the same, multiple candidate planning results are generated using efficiency preferences, safety preferences, and comfort preferences respectively. The structured trajectory planning result and candidate planning results at least include waypoint answers. Candidate selection steps: For complex scenarios, the current multi-view driving image, vehicle speed, navigation instructions, candidate icons, and waypoint answers from the multiple candidate planning results are input into the model, and the model outputs the selected candidate icon based on collision avoidance, road traffic requirements, driving progress, and motion smoothness; For simple scenarios, the single structured trajectory planning result is determined as the selected result. Trajectory decoding steps: According to the grid and word mapping established by the training method, decode the waypoint answers in the selected results to obtain the target trajectory.

[0011] A third aspect of this application provides an electronic device, including a memory and a processor, wherein the memory stores a grid configuration, waypoint lexical mappings, model parameters, and a computer program, and the processor, when executing the computer program, implements: the trajectory planning inference method of temporal waypoint encoding and preference adaptation, and / or, the trajectory planning training method of temporal waypoint encoding and preference adaptation.

[0012] A fourth aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements: the trajectory planning inference method of time-series waypoint encoding and preference adaptation, and / or the trajectory planning training method of time-series waypoint encoding and preference adaptation.

[0013] Compared with existing technologies, the trajectory planning model training and inference method based on temporal waypoint encoding and preference adaptation provided in this application achieves fine-grained controllable trajectory representation, geometric perception supervision, and trajectory generation and selection under multiple preference conditions within a unified model. Specifically, the use of independent lexical representations for time and coordinate components facilitates trajectory reconstruction; geometric soft targets ensure close supervision of neighboring coordinates; category sampling and waypoint lexical weighting increase the learning weight of low-frequency behaviors and trajectory components; multi-dimensional rewards jointly optimize scene description, inference, and trajectory; and preference conditions regulate driving behavior. In-model scene judgment and candidate selection allow for appropriate computational processes for simple and complex scenarios. Trajectory generation directly employs lexical decoding, enabling the connection between text inference and trajectory output within the same autoregressive model. In autonomous driving task experiments, both complete reward training and multi-preference candidate selection improved planning performance, and adaptive inference reduced the average latency compared to the previous multi-candidate process. Experimental conditions and results are detailed in the embodiments. Attached Figure Description

[0014] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings: Figure 1 A flowchart illustrating a trajectory planning model training method for temporal waypoint encoding and preference adaptation according to an exemplary embodiment; Figure 2 This is a schematic diagram illustrating the encoding of waypoints by time and coordinate components, the construction of soft targets, and the decoding of trajectories according to a preferred embodiment. Figure 3 The flowchart illustrates the multi-preference reinforcement learning and multi-channel reward optimization process during the training phase according to a preferred embodiment. Figure 4 A flowchart illustrating a trajectory planning model inference method for temporal waypoint encoding and preference adaptation according to an exemplary embodiment; Figure 5 The flowchart illustrates the scene determination, result generation, candidate selection, and decoding process of the inference stage according to a preferred embodiment. Figure 6 This is a flowchart illustrating the overall process of training preparation, training, and inference according to a preferred embodiment. Detailed Implementation

[0015] The present application will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present application, but do not limit the present application in any way. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of the present application, and these all fall within the protection scope of the present application. Parts not described in detail in the following embodiments can be implemented using existing technology.

[0016] In existing technologies, when representing trajectories as ordinary numerical text, the numerical values ​​may be split into multiple units by word segmentation rules, making the sequence length and parsing process uncontrollable. Using only the discretized correct units as the sole target also fails to express the geometric proximity relationships between coordinates. Another approach involves setting up a continuous action planner outside the visual language model, requiring management of the feature interface between language generation and action generation, and coordination of text supervision and continuous action supervision. Furthermore, vehicle planning involves different requirements such as risk, driving progress, and smoothness of motion; a single fixed preference is insufficient to reflect the trade-offs between multiple reasonable driving schemes. Continuously generating and comparing multiple candidates in simple scenarios increases computation, while generating only once in complex scenarios may be insufficient to compare different driving decisions. Based on the above problems, embodiments of this application provide a trajectory planning model training method based on temporal waypoint encoding and preference adaptation to solve one or more of the aforementioned problems.

[0017] Reference Figure 1 As shown, a trajectory planning model training method for temporal waypoint encoding and preference adaptation in one embodiment of this application includes: a training preparation step S100, a supervised fine-tuning step S200, and a reinforcement learning step S300. The same visual-language-action model is used, and the visual-language-action model in this embodiment can be an autoregressive model capable of simultaneously processing visual input, language input, and outputting a sequence of language lexical units. Specifically: S100, Training Preparation Steps: Acquire multi-view driving images, vehicle speed, navigation commands, and corresponding expert future trajectories; encode the expert trajectories into waypoints at N future time steps with uniform time intervals to obtain waypoint lexical sequences, with each waypoint lexical identifying its time step, coordinate components, and coordinate grid index; construct supervised data, which includes waypoint answers composed of waypoint lexical sequences and category supervised data for simple or complex scenarios labeled by the teacher model; Specifically, the waypoint lexical units mentioned above are artificially named lexical units uniquely based on three dimensions: time step, coordinate components, and grid index. Each waypoint lexical unit corresponds to a specific coordinate representation value, and this correspondence is fixed by the grid configuration and does not change with the word segmentation rules. The term "waypoint" refers to the discrete position point on the trajectory, and the term "lexical unit" refers to the vocabulary it is included in the language model, which is generated autoregressively by the language model just like generating ordinary lexical units.

[0018] In this embodiment, a time step identifies which future moment a waypoint belongs to, coordinate components identify whether the waypoint represents a longitudinal position, lateral position, or heading angle, and a grid index identifies which discrete grid point the component falls into at that time step. Combined, these three elements uniquely identify a coordinate value in the trajectory using a waypoint term. This naming method ensures that each coordinate value in the trajectory has an independent term, and that training, generation, and decoding use a consistent mapping, guaranteeing that the output can be reconstructed as a time-ordered coordinate sequence.

[0019] The aforementioned grid and lexical mapping form a set of correspondences used in the training preparation steps, subsequent supervised fine-tuning, and inference decoding. Since the language model can only generate lexical sequences, while the downstream trajectory tracking stage requires coordinate sequences, a reversible mapping between lexical units and coordinates needs to be established. Using the same mapping for training, generation, and decoding means that the lexical distribution learned during training, the lexical sequence output during generation, and the coordinate sequence reconstructed during decoding are all based on the same grid, preventing decoding bias caused by inconsistencies between training and inference.

[0020] Expert future trajectory refers to a sequence of vehicle positions provided by experts at a given sampling moment, spanning N time steps from the current moment, used as a monitoring target. N is a preset number of future time steps, which can be set according to the planning time domain; for example, N=10 with a time interval of 0.5 seconds corresponds to the next 0.5 to 5 seconds. Grid indexing constrains coordinate values ​​to a finite set of discrete representative values, eliminating the need to parse numerical text during decoding; coordinates are directly recovered through mapping. Time step and component identifiers help verify the completeness and correctness of the sequence.

[0021] S200, Supervision and Fine-tuning Steps: The training samples containing supervised data are weighted and sampled according to the motion categories of the expert trajectories. Geometric soft labels are constructed with the expert trajectories as a reference. The cross-entropy loss of geometric soft labels and the cross-entropy loss of waypoint lexical terms are combined to supervise and fine-tune the visual language action model. The scene judgment ability of the visual language action model is trained using multi-view driving images, vehicle speed and navigation commands as inputs and category-supervised data.

[0022] Specifically, hard tags set the target probability of the correct word to 1, and the rest to 0. Geometric soft tags, on the other hand, assign target probabilities based on the absolute distance between the coordinates of each grid point and the expert coordinates: the closer the distance, the higher the target probability.

[0023] S300, reinforcement learning steps: Using multi-view driving images, vehicle speed, navigation commands, and efficiency, safety, or comfort preferences as conditions, multiple structured trajectory planning results are sampled; for each structured trajectory planning result, the trajectory reward and process reward corresponding to its preference conditions are calculated, and the shared parameters of the visual language action model are optimized and updated using a group relative strategy; Specifically, the preference branches refer to three independent reward calculation paths: efficiency preference, safety preference, and comfort preference. The same trajectory yields different rewards under different preference conditions: efficiency preference rewards effective advancement, safety preference rewards proximity to the expert reference position, and comfort preference rewards smooth movement. Group relative strategy optimization samples multiple planning results from the same driving observation and the same preference, providing an advantage signal based on the relative quality of the results within the same group. Better planning results within the same group receive a positive advantage, while worse results receive a negative advantage.

[0024] In this approach, the feedback from samples corresponding to different preferences jointly updates the same set of shared parameters. This method of updating the same set of shared parameters across the three preference feedbacks avoids the parameter storage and maintenance requirements associated with deploying independent models for different preferences.

[0025] In this step, the structured trajectory planning result must include at least waypoint answers. N is the preset number of future time steps, which can be set according to the planning time domain. For example, N=10, with a time interval of 0.5 seconds, corresponds to the future time from 0.5 seconds to 5 seconds.

[0026] In the above embodiments of this application, the supervised data output by the training preparation step S100 is used by the supervised fine-tuning step S200. The supervised fine-tuning step S200 and the reinforcement learning step S300 update the same set of shared parameters, and the resulting trained model is used in the inference stage. The three steps maintain consistency through the grid and lexical mapping of the waypoint lexical sequence: the mapping established in the training preparation stage is used for loss calculation in the supervised fine-tuning stage and also for decoding in the inference stage. Through the training preparation step S100, the supervised fine-tuning step S200, and the reinforcement learning step S300, waypoint encoding, geometric supervision, and preference adaptation are completed sequentially in the same visual language action model. Waypoint lexical identifiers the time step, coordinate components, and coordinate grid index, enabling the trajectory to be reconstructed word by word; supervised fine-tuning and reinforcement learning update the same set of shared parameters, avoiding parameter redundancy in multi-preference, multi-model scenarios; the structured trajectory planning result includes waypoint answers, allowing the inference stage to directly decode the target trajectory.

[0027] To accurately represent trajectories in the lexical space of the language model while maintaining controllable sequence length, refer to Figure 2 As shown in some specific embodiments of this application, the waypoint coding in the training preparation step S100 can be performed using the following steps: S101 sets the value range, grid interval and number of discrete grid points for each time step and each coordinate component. Each grid point corresponds to a coordinate representative value, and an independent word set is established for each coordinate component of each time step. Specifically, the above establishes an independent lexical set for each coordinate component of each time step, meaning that lexical units from different time steps and different coordinate components are not shared. For example, the vertical position lexical units of the first future time step and the vertical position lexical units of the second future time step belong to different lexical sets.

[0028] This step establishes the basic correspondence between coordinate values ​​and lexical units. Each grid point corresponds to a specific coordinate value, so the coordinate value only needs to be mapped to the nearest grid point to be represented by the lexical unit corresponding to that grid point.

[0029] S102, Based on the set grid lower bound and grid interval, the offset of the component values ​​of the expert trajectory relative to the grid lower bound is divided by the grid interval, rounded to the nearest integer and limited to the effective index range to obtain the grid index; In this step, continuous expert trajectory coordinate values ​​can be converted into discrete grid indices. The offset of a component value relative to the lower grid boundary is divided by the grid interval to obtain the continuous position of that component value within the grid. After rounding to the nearest integer, the nearest grid point index is obtained. Then, coordinate values ​​exceeding the grid coverage area are processed by limiting them to the effective index range. The grid index obtained after rounding and limiting is a non-negative integer used to locate the corresponding word in the word set established in S101.

[0030] S103. Based on the obtained grid index, the words of each coordinate component are concatenated in chronological order to obtain the waypoint word sequence; wherein, the same grid and word mapping are used for training, generation and decoding.

[0031] In this step, the grid indices of each coordinate component can be converted into tokens and organized into a sequence in chronological order. Concatenating them in chronological order means first arranging the tokens of each coordinate component in the first future time step, then arranging them in the second future time step, and so on. The resulting waypoint token sequence is consistent with the chronological order of the future trajectory, and the coordinate sequence can be reconstructed by following the same order during decoding.

[0032] The consistent grid and lexical mapping used in training, generation, and decoding refers to the grid configuration and lexical set established in S101 to S103, which remain unchanged throughout the supervised fine-tuning, reinforcement learning, and inference decoding stages. The lexical distribution learned by the model during training, the lexical sequence output by the model during generation, and the coordinate sequence reconstructed during decoding are all based on the same set of mappings to avoid decoding deviations caused by inconsistent mappings.

[0033] In the above embodiments of this application, an independent set of terms is established for each time step and each coordinate component through S101, so that each coordinate value of the trajectory can be mapped to a specific term. The number of coordinate terms in the waypoint answer is determined by the number of future time steps and the number of coordinate components per step: 2N when only longitudinal and lateral positions are used, 3N when the heading angle is added, and 2 more terms are added when start and end markers are enabled. The number of grid points affects the size of the dedicated vocabulary, but does not change the length of the waypoint sequence under the same number of time steps and coordinate component configuration. It does not grow indefinitely with numerical precision. Through rounding and amplitude limiting in S102, the continuous expert trajectory coordinate values ​​are constrained to a finite number of discrete representative values. During decoding, there is no need to parse the numerical text; the coordinates are directly recovered by mapping. Through concatenation in chronological order in S103, the waypoint term sequence is made consistent with the chronological order of the future trajectory, which facilitates the verification of the chronological order and component integrity of the sequence during decoding.

[0034] In the above embodiments, the coordinate components include longitudinal and lateral positions, or longitudinal, lateral, and heading angles; specifically, the heading angle component represents the angle of the future vehicle orientation relative to the current orientation. With the introduction of the heading angle, each time step contains three coordinate units; for example, when N=10, there are 32 units including the start and end markers. By extending the heading angle component, waypoint coding can express changes in vehicle orientation, making it suitable for planning tasks that require controlling vehicle attitude.

[0035] In the above embodiments, the waypoint lexical sequence further includes a start identifier and an end identifier; the start identifier and end identifier are placed at the beginning and end of the waypoint lexical sequence, respectively, and are used to verify whether the sequence is complete and whether it has been truncated during the decoding stage. By setting the start and end identifiers, the decoding stage can verify the integrity of the sequence, avoiding incorrect decoding due to generation interruption.

[0036] In the above embodiments, setting different value ranges and the number of discrete grid points for different time steps takes into account the different positional distributions at different prediction times: the lateral offset of closer time steps is usually smaller, so a denser grid can be used; the lateral offset of farther time steps may be larger, so a wider coverage range can be used. This allows the lexical representation to adapt to the positional distribution characteristics at different prediction times.

[0037] In order to enable the model to learn descriptions and reasoning abilities that conform to driving scenarios during the supervised fine-tuning stage, while ensuring the determinism of waypoint answers, in some specific embodiments of this application, the construction of supervised data in training preparation step S100 can adopt the following steps: S401 extracts motion facts based on expert trajectory and current vehicle speed.

[0038] This step provides a factual basis for the subsequent generation of planning data.

[0039] Motion facts refer to the regularized information describing the vehicle's motion state extracted from the expert trajectory and the current vehicle speed. Specifically, they are extracted from adjacent displacements, speed changes, lateral offsets, and steering changes on the expert trajectory, combined with the current vehicle speed, including travel distance, starting, constant speed, acceleration / deceleration, stopping, turning, and overall driving intention. When generating planning data, the teacher model needs to base it on the actual motion of the expert trajectory, rather than generating it out of thin air. Motion facts are extracted in a regularized manner to ensure consistency with the expert trajectory.

[0040] S402 inputs multi-view images, vehicle speed, navigation instructions, motion facts, and specified preferences into the teacher model to generate scene descriptions and planning basis. It combines the planning basis and motion facts into planning reasoning text and encodes the expert trajectory into waypoint answers according to the same grid and word mapping as waypoint coding.

[0041] Specifically, the teacher model refers to a multimodal language model used to generate supervised data offline. The teacher model does not participate in online trajectory planning; it is only used during the training preparation phase. Multi-view images, vehicle speed, navigation instructions, motion facts, and specified preferences are input into the teacher model, which then generates scene descriptions and planning criteria.

[0042] The scenario description describes the road structure, traffic participants, and traffic control information visible in the image that affect driving. The planning rationale explains the reasons for taking the appropriate driving behavior under current preferences and is consistent with expert motion facts.

[0043] Planning reasoning texts consist of planning basis and movement facts. Combining the two allows the reasoning texts to have both factual basis and behavioral explanation.

[0044] Waypoint answers are generated by expert trajectories using the same grid and word mapping encoding as S101 to S103, ensuring that waypoint answers are consistent with waypoint encoding methods.

[0045] This step generates the text and trajectory portions of the supervised data. The text portion includes scenario descriptions and planning reasoning text, while the trajectory portion represents the waypoint answers.

[0046] S403 involves a teacher model labeling simple or complex scenarios based on multi-view driving images, vehicle speeds, and navigation instructions to obtain scenario category supervision data. Among these, different preference samples constructed for the same expert trajectory use the same waypoint answers, and the preference differences are reflected in the differences in input conditions and planning inference text.

[0047] Specifically, the scene category supervision data consists of labels annotated by the teacher model, indicating whether a scene is simple or complex. The teacher model annotates based on multi-view driving images, vehicle speed, and navigation instructions, and the annotation results are used to train the model's scene judgment ability.

[0048] For the same expert trajectory, regardless of whether the corresponding preference is efficiency, safety, or comfort, the waypoint answer remains unchanged. The difference in preferences is reflected in the differences in input conditions and planning inference text; that is, different preference samples contain different preference hints in their input conditions, and the focus of the planning inference text also differs, but the waypoint answers are the same.

[0049] This step provides supervised data for different scenario categories and clarifies how preference differences are represented. During the supervised fine-tuning data construction phase, different preference samples corresponding to the same expert trajectory share the waypoint answers encoded by that expert trajectory. Preference differences are reflected in the input prompts and planning inference text to maintain consistency between the supervised answers and existing expert trajectories. Subsequently, in the reinforcement learning phase, the model is optimized based on the reward objectives corresponding to different preferences, learning trajectory generation behavior under different preferences.

[0050] In the above embodiments, S401 extracts motion facts, ensuring the planning basis has a factual foundation and preventing the teacher model from generating inference text that does not match the expert trajectory; S402 combines the planning basis and motion facts into planning inference text, giving the inference text both behavioral explanation and factual basis; waypoint answers are encoded using the same mapping as waypoint codes, ensuring consistency between the supervision data and the model output format; S403 has the teacher model label the scene categories, providing a target for training the model's scene judgment ability. Operations S401-S403 ensure that different preference samples of the same expert trajectory use the same waypoint answers, preventing noise from being introduced by waypoint answers changing with preferences.

[0051] To address the problem of insufficient learning of low-frequency driving behaviors due to uneven distribution of motion categories, in some specific embodiments of this application, the weighted sampling in the supervised fine-tuning step S200 can adopt the following steps: S501, based on the signed cumulative turning angle of the expert trajectory, the samples are divided into straight or turning categories. The straight category is further divided into acceleration, deceleration or constant speed according to the speed change in the first and second halves. The turning category is further divided into gentle curve or sharp curve according to the size of the cumulative turning angle, resulting in seven categories: straight constant speed, straight acceleration, straight deceleration, left gentle curve, left sharp curve, right gentle curve and right sharp curve.

[0052] Specifically, the signed cumulative turning angle refers to the angle value obtained by adding up the angles after correcting the changes in the direction angles of adjacent trajectory segments to [-π, π]. Positive and negative signs distinguish left and right. The specific division method is as follows: an absolute cumulative turning angle of less than 0.1 radians is considered straight, 0.1 to less than 0.4 radians is considered a gentle curve, and not less than 0.4 radians is considered a sharp curve. For straight trajectories, the ratio of the average speed of the second half to the average speed of the first half is taken: a ratio greater than 1.2 indicates acceleration, a ratio less than 0.8 indicates deceleration, and the rest is considered constant speed; if the speed in the first half is less than 0.5 meters per second, and the speed in the second half is greater than 1 meter per second, it is considered acceleration; otherwise, it is considered constant speed.

[0053] This step categorizes expert trajectories into seven classes based on motion characteristics, enabling subsequent sampling to specifically increase learning opportunities for low-frequency driving behaviors. Without classification, high-frequency categories such as straight-line driving at constant speed would occupy a large proportion of the sample distribution, while low-frequency categories such as turning, acceleration, and deceleration would have insufficient learning opportunities.

[0054] S502 applies a temperature power transform and a category adjustment coefficient to the sample frequencies of each category to obtain the sampling probability of each category.

[0055] Specifically, the temperature power transform refers to applying a power less than 1 to the category frequencies. The larger the temperature parameter, the smaller the power; the frequency of high-frequency categories is suppressed, while the frequency of low-frequency categories is relatively increased, thus reducing the probability difference between high-frequency and low-frequency categories. The category adjustment coefficient is used to add extra weight to specific categories; for example, in one embodiment, a coefficient of 1.3 is used for right-hand curves and sharp right-hand curves, and 1 for the rest. The sampling probability of each category is obtained by multiplying its frequency by the category adjustment coefficient after the power transform, and then normalizing for all categories.

[0056] This step adjusts the sampling probabilities of each category to avoid oversampling of high-frequency categories, while allowing for additional weighting of specific categories.

[0057] S503, determine the individual sample weight based on the sampling probability and sample size of each category, and perform sampling with replacement on the samples according to the individual sample weight.

[0058] Specifically, single-sample weight refers to the weight determined based on the sampling probability and the number of samples of its class, so that the total sampling proportion of that class matches its sampling probability. Sampling with replacement using single-sample weight allows samples of low-frequency classes to be used repeatedly during training, increasing their learning proportion.

[0059] In the above embodiments S501-S503, low-frequency driving behaviors are identified through seven-class classification. The sampling probabilities of each class are adjusted through temperature power transform and class adjustment coefficients. Then, low-frequency class samples are repeatedly used in training through sampling with replacement and single-sample weighting. These three steps sequentially complete the process from identifying low-frequency classes, adjusting sampling probabilities, to increasing the proportion of low-frequency classes used. Together, they enable the model to be exposed to more low-frequency driving behavior samples during training, improving its adaptability to scenarios such as turning and acceleration / deceleration, while avoiding oversampling of high-frequency classes.

[0060] In order for the model to learn the geometric proximity relationships between coordinates, continue to refer to Figure 2 In some specific embodiments of this application, the following steps can be used for the geometric soft tag in the supervision and fine-tuning step S200: S601: For the same time step and the same coordinate component, calculate the absolute difference between the coordinate representative value and the expert component value of each effective grid point, and select at most K grid points with the smallest absolute difference to form a nearest neighbor set.

[0061] Specifically, effective grid points refer to the grid points that participate in the prediction probability normalization at a given time step and coordinate component. For each time step and component, the absolute difference between the representative coordinate value of each effective grid point and the expert component value is calculated, and the grid points corresponding to the smallest absolute differences are selected to form a nearest neighbor set. Each component operates independently, without searching for nearest neighbors across time steps or components. Geometric soft labels need to allocate target probabilities among multiple neighboring grid points, selecting the largest number of grid points with the smallest absolute differences, so that the target probabilities are concentrated on the grid points closest to the expert values.

[0062] S602, after dividing the negative absolute difference of each grid point in the nearest neighbor set by the temperature parameter of the corresponding component, is exponentially normalized to obtain the soft target probability within the set, and the soft target probability of grid points outside the nearest neighbor set is zero; wherein, the model prediction probability is normalized within all effective grid points of the same component at the same time step.

[0063] Specifically, the temperature parameter is a scaling parameter in probability normalization, and its unit is consistent with its corresponding component. Temperature controls the degree to which the probability is distributed among neighboring grid points: the higher the temperature, the flatter the probability distribution, with multiple neighboring grid points sharing the target probability; the lower the temperature, the more concentrated the probability distribution, with the target probability concentrated on the nearest grid point. Separate temperature parameters are used for the longitudinal, lateral, and heading angles when activated.

[0064] S603 calculates the geometric soft tag cross-entropy loss based on the constructed geometric soft tag.

[0065] Specifically, the model's predicted probabilities are compared with the soft target probabilities, and cross-entropy is calculated. The closer the grid points are, the higher the soft target probability, and the lower the cross-entropy is when the model assigns higher predicted probabilities to these grid points; when the model assigns higher predicted probabilities to distant grid points, the predicted probabilities obtained by nearby grid points decrease, and the cross-entropy increases.

[0066] The above embodiment employs three steps, S601-S603, which results in a smaller cross-entropy when the model assigns higher prediction probabilities to neighboring grid points. This allows the model to obtain training signals from near-correct predictions while maintaining suppression of predictions far from experts, thus improving the accuracy and training efficiency of trajectory generation. This addresses the shortcomings of hard-label supervision in the background technology, which struggles to express the geometric proximity between coordinates and where both predicting adjacent coordinates and predicting distant coordinates fall into the error category.

[0067] In order to take into account both geometric supervision of the trajectory and lexical supervision of the sequence in supervised fine-tuning, in some specific embodiments of this application, the loss calculation in the supervised fine-tuning step S200 can adopt the following steps: S701, calculate the soft tag cross-entropy of each coordinate component, average it over the effective waypoints and sum it according to the component weights to obtain the geometric soft tag cross-entropy loss.

[0068] Specifically, a valid waypoint refers to a waypoint that participates in the loss calculation at that time step and for that component, and has all its components. Waypoints lacking necessary components are not included in the average. For a set of valid waypoints with all components in a batch of samples, the soft-label cross-entropy of each coordinate component is calculated separately, averaged over the valid waypoints, and then summed according to component weights to obtain the geometric soft-label cross-entropy loss. The weights of each component can be set according to the characteristics of the component; the weight of the vertical position can be greater than the weights of the horizontal position and heading angle. Calculating each component separately and averaging it over the valid waypoints can avoid loss imbalance caused by different numbers of waypoints for different components; summing according to component weights ensures that different components receive a level of supervision commensurate with their importance.

[0069] S702 assigns weights to the lexical units participating in sequence supervision, making the weights of waypoint-specific lexical units greater than the weights of ordinary text lexical units, and normalizes the sequence cross-entropy by the sum of the effective lexical unit weights.

[0070] Specifically, waypoint-specific terms refer to the portion of waypoint terms used to represent trajectory structure, including trajectory start and end terms and coordinate component terms. Ordinary text terms refer to terms in scene descriptions and planning reasoning text. Weights are assigned to effective terms participating in sequence supervision, with waypoint-specific terms having a greater weight than ordinary text terms. Placeholder terms for filling positions and images are not included in the sequence loss. The sequence cross-entropy is normalized by the sum of the effective term weights, ensuring that the sequence loss is unaffected by changes in the number of effective terms.

[0071] S703 uses a weighted combination of sequence cross-entropy and geometric soft-label cross-entropy loss as the supervised fine-tuning loss.

[0072] Specifically, the sequence cross-entropy obtained from S702 and the geometric soft-label cross-entropy loss obtained from S701 are combined according to weights to serve as the total loss for supervised fine-tuning. Sequence cross-entropy supervises the generation of word sequences, while geometric soft-label cross-entropy supervises the geometric relationships between coordinates.

[0073] In the embodiments described above, the model simultaneously learns the generation of lexical sequences and the geometric relationship between coordinates, enabling supervised fine-tuning to take into account both the geometric supervision of the trajectory and the lexical supervision of the sequence, thereby improving the accuracy of trajectory generation and the ability to generate text.

[0074] In order to enable the same model to have the ability to judge scene complexity, in some specific embodiments of this application, for the scene judgment training in the supervised fine-tuning step S200, the following can be done: take multi-view driving images, vehicle speed and navigation instructions as input, and take the simple scene or complex scene labels marked by the teacher model as the target, and perform supervised fine-tuning on the visual language action model so that the scene category prediction ability is integrated into its shared parameters.

[0075] Specifically, scenarios with smooth traffic flow, minimal interaction among road users, and stable travel along the current road can be categorized as simple scenarios; scenarios requiring consideration of multiple decisions, such as intersections, lane changes or merging, pedestrian and vehicle interactions, and obstacle avoidance, can be categorized as complex scenarios. Scenario judgment training shares the same model with waypoint encoding learning, scenario description, and planning reasoning learning. Scenario category prediction capabilities are integrated into shared parameters, without introducing an additional independent scenario classification model.

[0076] By training the same model with simple or complex scene labels labeled by the teacher model as the target, the scene category prediction capability is integrated into the shared parameters, avoiding the introduction of an additional independent scene classification model in the inference stage; scene judgment, waypoint generation and text generation share the same model, reducing the number of system modules and interface overhead.

[0077] Reference Figure 3 As shown, in order to obtain reward signals that match the preferences of trajectories under different preference conditions, in some specific embodiments of this application, the trajectory reward in reinforcement learning step S300 can adopt the following steps: S901 uses the product of the no-fault collision score and the drivable area compliance score, combined with trajectory smoothness conditions, for joint gating. Trajectory rewards for failing the gating are zero.

[0078] Specifically, the no-fault collision score reflects whether the trajectory corresponds to a collision for which the vehicle should bear responsibility; the drivable area compliance score reflects whether the trajectory complies with drivable area constraints; and the trajectory smoothness condition excludes trajectories with excessively high smoothness indices. Common gating is based on the product of the no-fault collision score and the drivable area compliance score. This product means that if either score is lower, the gating value will be lowered. Trajectories that fail the gating receive zero reward, meaning they are not included in the reward calculation for subsequent preference branches. This filters out trajectories with safety issues before calculating rewards for gating trajectories that pass the gating according to preferences. Without common gating, trajectories with collision liability or violations of drivable area constraints might still receive rewards in preference branches, causing the model to learn unsafe driving behaviors.

[0079] S902, when passing through the gating, the efficiency preference determines the net progress reward based on the predicted distance to the endpoint along the overall direction of the expert's progress, the lateral drift of the endpoint, and the expert's reference journey.

[0080] Specifically, the overall direction of travel is determined by the expert's endpoint. The longitudinal distance to the predicted endpoint is subtracted from the lateral drift, and then normalized using the expert reference route. Using the fixed expert route as a reference, shortening the journey in the correct direction will decrease net progress, while the increased path length due to detours will not directly improve this metric. The role of net progress is to prevent the model from relying solely on shortening the journey or taking detours to obtain high rewards.

[0081] S903, when passing through gating, the safety preference determines the reward based on the weighted error of the horizontal and vertical components of the predicted trajectory relative to the expert trajectory; the comfort preference determines the reward based on the trajectory smoothness index and the fluctuation of the displacement length of adjacent time steps.

[0082] Specifically, using the expert trajectory as a position reference, the position error is decomposed into a longitudinal component along the expert's local heading and a lateral component perpendicular to that heading, and the average displacement error is calculated in a weighted manner. For the same value, the lateral error incurs a larger penalty than the longitudinal error, making the model pay more attention to lateral position deviations while retaining longitudinal deviation feedback.

[0083] The predicted trajectory is concatenated with the origin. For each position, the local average of its own position and that of its adjacent positions is taken. Then, the smoothed trajectory positions are subjected to second-order difference, and the root mean square of the magnitude of the difference vector is used as the trajectory smoothness index. The standard deviation of the displacement length between adjacent time steps is calculated. At a fixed time interval, the fluctuation of the displacement length reflects the change in motion rhythm; the smoothness index reflects the smoothness of local position changes. The two are exponentially mapped and then geometrically averaged to ensure that the comfort feedback considers both local changes and the overall displacement rhythm.

[0084] It should be noted that the rewards for the three branches of efficiency preference, safety preference, and comfort preference respectively reflect the trade-offs between effective propulsion, reference position deviation, and motion smoothness; the feedback from these three preferences jointly updates the same set of parameters, enabling the same model to adapt to different preference conditions. The feedback from samples corresponding to different preferences jointly updates the same set of shared parameters.

[0085] Continue to refer to Figure 3 To make the reward calculations for safety and comfort preferences more aligned with actual driving needs, in some specific embodiments of this application, the following steps can be used for calculating the rewards for safety and comfort preferences: S1001, along the expert local heading, the predicted position error is decomposed into longitudinal and lateral components. The average displacement error is calculated by weighting the lateral component with a greater weight than the longitudinal component, and then mapped to the reward through exponential decay.

[0086] Specifically, using the expert trajectory as a position reference, the local expert heading is determined by central difference after incorporating the origin, with backward difference used for the endpoint. The position error is decomposed into a longitudinal component along the local heading and a lateral component perpendicular to that heading, and the average displacement error is calculated using a weighted method. Lateral errors of the same value incur a larger penalty than longitudinal errors, making the model pay more attention to lateral position deviations while retaining longitudinal deviation feedback. The average displacement error is mapped to a reward through exponential decay, ensuring a smooth decrease in reward as the error increases.

[0087] S1002, perform local averaging on the predicted trajectory including the origin, and calculate the root mean square of the second-order difference vector magnitude of the smoothed position as the trajectory smoothness index.

[0088] Specifically, the predicted trajectory is concatenated with the origin, and for each position, a local average is taken of itself and its neighboring positions. Boundary positions only use existing neighboring points. Then, a second-order difference is performed on the smoothed trajectory positions, and the root mean square of the magnitude of the difference vector is used as the trajectory smoothness index. Local averaging can reduce the impact of noise on the smoothness index; the second-order difference reflects the curvature of the trajectory.

[0089] S1003, calculate the standard deviation of the displacement length of adjacent time steps.

[0090] Specifically, the displacement length between adjacent time steps is calculated, and then the standard deviation of these displacement lengths is calculated. At a fixed time interval, the fluctuation in displacement length reflects changes in the motion rhythm. The larger the standard deviation, the more drastic the changes in the motion rhythm.

[0091] S1004, after exponentially mapping the trajectory smoothness index and standard deviation respectively, takes the geometric mean to obtain the comfort preference reward.

[0092] Specifically, the trajectory smoothness index obtained from S1002 and the standard deviation obtained from S1003 are respectively subjected to exponential mapping so that a larger index value corresponds to a smaller reward value; then the geometric mean of the two is taken so that if either the smoothness index or the displacement fluctuation is worse, the reward will be lowered.

[0093] It should be noted that the weighting method in safety preference imposes a greater penalty on lateral errors, considering that lateral deviations are more likely to lead to lane departure and collision risks; while the geometric mean in comfort preference reduces rewards if either the smoothness index or displacement fluctuation is poor.

[0094] The above embodiments can make the reward calculation of safety preference and comfort preference more in line with actual driving needs.

[0095] To effectively aggregate multiple reward channels and utilize reasoning utility to evaluate the aid of reasoning text to trajectory prediction, we will continue to refer to... Figure 3 In some specific embodiments of this application, the group-relative policy optimization in reinforcement learning step S300 can be performed using the following steps: S1101 samples multiple structured trajectory planning results from the same multi-view driving image, vehicle speed, navigation commands, and the same preference.

[0096] Specifically, the structured trajectory planning results also include a scenario description and planning inference text. For the same driving observation and the same preferences, multiple structured trajectory planning results are sampled, each containing a scenario description, planning inference text, and waypoint answers. These sampled planning results form a group for subsequent group comparisons.

[0097] S1102, calculate the trajectory answer reward, scenario description reward, format reward and reasoning utility reward for each planning result respectively.

[0098] Specifically, the trajectory answer reward evaluates the quality of the trajectory corresponding to the waypoint answer; the scene description reward evaluates the factual accuracy and completeness of the scene description, which can be evaluated by the multimodal evaluation model after inputting the current multi-view driving image and the generated description together; the format reward evaluates the completeness of each output segment of the scene description, planning reasoning text and waypoint answer, as well as whether the waypoint answer is parsable; and the reasoning utility reward evaluates whether the generated reasoning enhances the model's support for reasonable actions.

[0099] The inference utility reward is determined based on the difference in the average conditional log-likelihood of the model's answers to the same expert waypoint, given and without the provision of generated inference text. If the model's likelihood of the expert answer is higher when inference is provided, it indicates that the inference is helpful for trajectory prediction, and the inference utility reward is positive; if the likelihood is lower or there is no significant difference when inference is provided, the inference utility reward is smaller or zero. The calculation involves sequentially providing the preceding words of the expert answer and measuring the model's prediction probability for the current expert word; this process is used for training evaluation and the expert answers are not used as input for online planning.

[0100] S1103, each reward channel is grouped and normalized separately, then aggregated by weight and batch normalized to obtain the advantage estimate.

[0101] Specifically, for each planning result within the same group, group normalization is performed within each reward channel, i.e., subtracting the within-group mean of that channel and dividing by the within-group standard deviation of that channel. Channel-specific group normalization can reduce the impact of scale differences between different reward channels; channels with the same within-group value do not provide relative superiority or inferiority signals. The normalized values ​​of each channel are aggregated according to weights, and then batch normalization is performed on the aggregated values ​​in the training batch to obtain the advantage estimate.

[0102] S1104, update shared parameters by combining reference policy constraints and policy probability ratio pruning.

[0103] Specifically, the relative feedback of the group is used as the benefit at the end of the structured trajectory planning result generation, and a word-level constraint relative to the reference strategy is added to form an advantage acting on the generated words. The strategy is updated based on the word probability ratio between the current strategy and the sampling-related strategy, and the probability ratio is pruned to limit single strategy changes. When asynchronous sampling exists, the difference between the sampling strategy and the strategy before the update is further corrected by the importance ratio.

[0104] Reference Figure 4 , Figure 5 As shown, based on the same technical concept, in another embodiment of this application, a trajectory planning model inference method of temporal waypoint encoding and preference adaptation is also provided, which can adopt the following steps: S1201, the model outputs a simple or complex scene category based on the current multi-view driving images, vehicle speed, and navigation instructions.

[0105] Specifically, the current multi-view driving images, vehicle speed, and navigation commands are input into the visual language action model trained using the above training method. The model then determines whether the current scene is a simple or complex scene. Situations with smooth traffic flow, minimal interaction among traffic participants, and stable driving along the current road can be classified as simple scenes; situations requiring consideration of multiple decisions, such as intersections, lane changes or merging, pedestrian and vehicle interactions, and obstacle avoidance, can be classified as complex scenes.

[0106] By differentiating the complexity of scenarios, a basis is provided for allocating computing resources according to complexity in the future.

[0107] S1202: For complex scenarios, keep the input multi-view driving images, vehicle speed, navigation commands and model parameters the same, and generate multiple candidate planning results using efficiency preference, safety preference and comfort preference respectively; for simple scenarios, generate a single structured trajectory planning result using preset preferences.

[0108] Specifically, in simple scenarios, the model uses preset preferences to generate a planning result that includes a scenario description, planning reasoning text, and waypoint answers. In complex scenarios, while maintaining consistency between driving observations and model parameters, efficiency preferences, safety preferences, and comfort preferences are added respectively to generate multiple candidate results, which are then associated with and saved with candidate identifiers. Multiple conditions can be organized as batch inputs and use the same format to complete candidate generation.

[0109] This step allocates computational resources according to the complexity of the scenario. Simple scenarios generate a single result, reducing unnecessary computation for generating multiple candidates; complex scenarios generate multiple preference candidates, enabling the comparison of different driving decisions within the same scenario.

[0110] S1203 For complex scenarios, the current multi-view driving images, vehicle speed, navigation instructions, candidate icons, and waypoint answers from multiple candidate planning results are input into the model. The model then outputs the selected candidate icons based on collision avoidance, road traffic requirements, driving progress, and motion smoothness.

[0111] Specifically, the current driving observations, candidate identifiers, and the answers to each candidate waypoint are all input into the same model. The model then compares these options based on factors such as collision avoidance, road conditions, driving progress, and motion smoothness, and outputs the selected identifier along with a brief rationale. This allows for the selection of the final result from multiple preferred candidates in complex scenarios.

[0112] S1204. Based on the grid and word mapping, decode the waypoint answers in the selected results to obtain the target trajectory.

[0113] Specifically, based on the candidate identifiers, the waypoint answers of the selected results are read. Following the grid and word mapping established in the training preparation steps, each waypoint word in the waypoint answer is decoded to recover the coordinate components of N future time steps, and the target trajectory is output in chronological order. For simple scenarios, a single result directly proceeds to this step.

[0114] The above scenario category judgment, preference candidate generation, and candidate selection reuse the same model; the inference stage does not read the expert's future trajectory.

[0115] In the embodiments described above, S1201 determines the scene complexity, providing a basis for allocating computing resources according to complexity; S1202 generates a single result for simple scenes and multiple preference candidates for complex scenes, enabling the allocation of computing resources according to scene complexity; and S1203 allows the same model to select the final result from multiple candidates without the need for an additional independent scoring network. These three steps together enable the trained model to allocate computing resources based on scene complexity and generate and select multiple preference candidates in complex scenes.

[0116] To adapt to different deployment conditions and computing resources, in some specific embodiments of this application, the candidate selection step in S1203 can be carried out in either of the following two ways: First, the candidate selection step is completed by the visual language action model.

[0117] Specifically, the current multi-view driving images, vehicle speed, navigation commands, candidate icons, and waypoint answers from each candidate planning result are input into the same visual language action model. This model then outputs the selected candidate icons based on collision avoidance, road traffic requirements, driving progress, and motion smoothness. This method reuses shared parameters obtained during the training phase, eliminating the need for additional training of a scoring network. This approach can complete candidate selection without adding extra models and is suitable for deployment scenarios where the number of system modules is constrained.

[0118] Second, the candidate selection step is completed by an independent scoring network. The scoring network integrates image features, candidate positions and vehicle speeds, and uses the simulation planning evaluation score as the regression training target.

[0119] Specifically, the independent scoring network takes fused image features, candidate locations, and vehicle speed as input, and uses the simulation planning evaluation score as the regression training objective. It outputs a score for each candidate and selects the candidate with the highest score. This approach decouples the selection process from the language model and is suitable for scenarios that require reducing the computational cost of a single inference or that require selection independent of the language model.

[0120] The above embodiments provide two candidate selection methods, enabling the solution to adapt to different deployment conditions: when using the same model for selection, there is no need to train an additional scoring network, reducing parameter storage; when using an independent scoring network, the selection process can be decoupled from the language model, adapting to different computational resource constraints.

[0121] In order to ensure that the waypoint lexical sequences generated by the model can be accurately reconstructed into the target trajectory, in some specific embodiments of this application, the trajectory decoding step in S1204 can adopt the following steps: S1401, check the length, time step identifier, and component identifier of the selected waypoint answer, and check these two types of identifiers when the waypoint answer includes a start identifier and an end identifier; Specifically, the method point answers of the selected results are read, and it is checked whether the number of waypoint terms matches the expected number of time steps and coordinate components. The time step identifiers of each waypoint term are checked to ensure they are arranged in order and that all component identifiers are complete. When start and end identifiers are enabled, it is checked whether they exist and are located at the beginning and end of the sequence, respectively. If the checks fail, it indicates that the sequence generation is interrupted, the order is disordered, or components are missing; the decoding process may terminate or an error message may be displayed.

[0122] S1402, extract the grid index of each waypoint terminology, and recover the coordinate components of N future time steps according to the corresponding grid lower bound and grid interval.

[0123] Specifically, the grid index is extracted from the waypoint lexicons. Following the grid and lexicon mapping established in the training preparation steps, the coordinate representative value of that time step and coordinate component is recovered by adding the product of the grid index and the grid interval to the corresponding lower bound of the grid. After recovering the coordinate components of all N future time steps, a coordinate sequence of N future time steps is obtained.

[0124] S1403, outputs the target trajectory in chronological order.

[0125] Specifically, the coordinate components of the N future time steps recovered from S1402 are arranged in chronological order to output the target trajectory.

[0126] In the above embodiments of this application, the sequence integrity is checked in S1401 to promptly detect generation interruptions, disordered sequences, or missing components; the coordinate components are restored according to the grid and lexical mapping in S1402, so that the lexical sequence is deterministically restored to the coordinate sequence; and the target trajectory is output in chronological order in S1403 for use in subsequent trajectory tracking stages. This ensures that the waypoint lexical sequence generated by the model can be accurately restored to the target trajectory.

[0127] The present application will be further described below with reference to specific preferred embodiments / comparative examples in order to better understand the implementation of the above technical solutions of the present application. It should be understood that the following are only some examples and are not intended to limit the present application.

[0128] The following example illustrates the execution process in three stages: training preparation, training, and inference, using a configuration of N=10 and a future time interval of 0.5 seconds. A unified model for scene understanding, trajectory representation, and preference post-training is employed, and candidate generation and comparison calculations are assigned according to scene complexity.

[0129] Specifically, refer to Figure 6As shown, in the training preparation phase, the expert's future N-step trajectory is encoded into waypoint lexical units with independent time and coordinate components, constructing scene description, planning inference, waypoint answers, and scene category supervision data. In the training phase, weighted sampling is performed according to motion category, and supervised fine-tuning is conducted using geometric soft-label cross-entropy and lexical weighted cross-entropy. Then, the same visual language action model is optimized using multi-preference trajectory rewards and process rewards. In the inference phase, the model determines the scene category; simple scenes generate a single structured trajectory planning result, while complex scenes generate multi-preference candidates which are selected by the model, and the target trajectory is decoded.

[0130] In this embodiment, S11 corresponds to the training preparation stage (S100 mentioned above), S21 corresponds to the supervised fine-tuning stage (S200 mentioned above), S22 corresponds to the reinforcement learning stage (S300 mentioned above), and S31-S34 correspond to the four steps of the inference stage (S1201-S1204 mentioned above). The data and lexical mappings output from the training preparation stage are used for training, and the shared parameters output from the training stage are used for inference; the expert's future trajectory is not read during the inference stage. Finally, the application performance of the autonomous driving task is given.

[0131] First, the training preparation phase S11 (a) Driving data and surveillance labels At each sampling time, driving images captured by cameras from different perspectives are acquired and organized into a multi-image input according to a predetermined perspective order. These images, combined with the current vehicle speed, navigation instructions, and specified driving preferences, constitute the model's input conditions. Vehicle speed is expressed in meters per second, and navigation instructions specify driving requirements such as going straight, turning left, and turning right.

[0132] During the training preparation phase, the expert future trajectory corresponding to the driving observation is acquired synchronously and transformed into a local coordinate system with the current vehicle as the reference. The positive longitudinal direction points forward of the vehicle, the positive lateral direction points to the left of the vehicle, and the heading angle is the angle between the future vehicle orientation and the current orientation. N future waypoints are obtained at uniform time intervals. In this embodiment, N=10 and the interval is 0.5 seconds, corresponding to the future 0.5 seconds to 5 seconds; this specific setting is used for the ten-step calculation in the following training reward.

[0133] To construct supervised samples, regularized motion facts are first extracted from adjacent displacements, velocity changes, lateral offsets, and steering changes in the expert trajectory, combined with the current vehicle speed. These facts include driving distance, starting, constant speed, acceleration / deceleration, stopping, turning, and overall driving intent. Then, the driving image, speed, navigation instructions, motion facts, and specified preferences are input into a multimodal language model to generate a scene description and planning rationale. The scene description describes the road structure, traffic participants, and traffic control information visible in the image that influences driving; the planning rationale explains the reasons for taking corresponding driving actions under the current preferences and is consistent with the expert motion facts.

[0134] The generated planning basis and rule-based movement facts are combined into a planning reasoning text, organized into three sections labeled "description," "thinking," and "answer." Waypoint answers are directly encoded from expert trajectories using a grid; the same expert trajectory uses the same waypoint answer in different preference samples. Efficiency preference samples highlight conditions for effective propulsion, safety preference samples highlight risks and uncertainties, and comfort preference samples highlight road and traffic changes requiring smooth movement. The three preference categories are assigned to the sample set, exposing the same model to different preference conditions; a single original sample can correspond to one of these preferences.

[0135] The expert's future trajectory and the motion facts extracted from it are used to construct labels offline; during online planning, the model autonomously generates planning results based on the current image, speed, navigation, and preferences.

[0136] During the training preparation phase, multi-view driving observations, vehicle status, and navigation requirements are provided to the teacher model, which is then labeled with simple or complex scene categories, and the correspondence between observations and category labels is saved. These labels are used for scene category supervision during the training phase; the teacher model does not participate in online trajectory planning.

[0137] (ii) Time-series waypoint coding Let the time step index be t∈{0,…,N} 1}, the basic coordinate components a∈{x,y} represent the longitudinal and lateral positions respectively; the heading angle h can be added if necessary. For each pair (t,a), configure the lower bound of the grid b, the interval Δ and the number of discrete grid points M, and establish an independent word set. The number of grid points represents the number of possible coordinate representation values ​​for this component. The encoding index of the component value z and its corresponding coordinates are determined according to equation (1):

[0138]

[0139] Where `round` rounds the nearest integer, taking an even number when it's exactly the midpoint between two integers; `clip` restricts the index to a valid range. Position components use a preset position resolution, and the heading angle interval is the angle interval span divided by the number of grid points. When resampling is required, position is linearly interpolated over time; heading angles are first eliminated by eliminating jumps across period boundaries before interpolation, and then normalized to [ ] using a 2π period. After π, π), the index is calculated and the amplitude is limited according to the heading angle grid. The coordinates corresponding to the encoded index of the component value z. This represents the discrete grid index corresponding to the a-th coordinate component at the t-th future time step.

[0140] Table 1 provides an example of a grid configuration with N=10, where x and y constitute the basic representation, and h is an optional extension. Each time step's lexical unit has an independent time identifier.

[0141] Table 1. Ten-step trajectory component grid parameters

[0142] Each lexical is named using the format "time step + component + index", for example...<t00_x_04> According to Table 1, the vertical position of the first future time step is 2 meters. The basic representation is a concatenation of x and y values ​​at each step; N steps contain 2N coordinate units; when N=10, there are 20 units. If additional...<traj_start> and<traj_end> The start and end markers are encapsulated in a sequence of 22 tokens, and these markers are not included in the coordinate token count. The dedicated vocabulary for this configuration contains 10 × (51 + 65) + 2 = 1162 tokens. Adding 'h' results in three coordinate tokens per step, totaling 32 tokens across ten steps including the start and end markers, corresponding to a vocabulary of 1802 tokens.

[0143] The encoding phase establishes a fixed correspondence between grid cells and terms, which is then saved for use by S21, S22, and S34. Each time step allows for setting the coverage area and the number of grid points to accommodate different location distributions at different prediction times. Specific decoding steps are explained in the inference phase.

[0144] Second, the training phase (a) Monitoring the fine-tuning process S21 New waypoint terms are registered to the word segmenter and word embeddings are expanded, enabling the model to predict trajectory terms as if they were predicting text terms. Hard labels constrain the target index, while geometric soft labels describe the proximity of neighboring coordinates to expert values.

[0145] For each time step t and component a, let the set of valid grid point indices be . The expert component value is The coordinates of the kth grid point are Calculate the distances separately. Then select the indices corresponding to the smallest K distances to form a nearest neighbor set. Each component operates independently, without searching for nearest neighbors across time steps or components.

[0146]

[0147] (2) In the above formula, TopKSmallest represents selecting the smallest at most K elements from the set; This represents the absolute difference, or distance, between the coordinates of the k-th grid point and the expert component value. This represents the nearest neighbor set consisting of the grid point indices corresponding to these minimum distances.

[0148] Temperature was used to measure the longitudinal, lateral, and heading angles during activation. , , The soft target is generated using equation (3).

[0149] (3) in, This represents the probability of a soft target (the probability of a single sample being a soft target at time step t, coordinate component a, and grid point k). The closer the target, the higher the probability of a soft target. Temperature parameter. This is used to control the rate at which the target probability decays with increasing geometric distance, and its unit is consistent with the corresponding component. A set of parameters is K=5. = 1 meter =0.5 meters = 0.1 radians. For example, if the longitudinal expert value is 2 meters and the five nearest representative values ​​are 0, 1, 2, 3, and 4 meters, the corresponding probabilities are approximately 0.06745, 0.18335, 0.49840, 0.18335, and 0.06745, respectively.

[0150] After reading the current observation, cue, and preceding terms, the model needs to predict a specific coordinate component at the current time step. To evaluate this coordinate selection, the prediction probability is calculated from all valid grid points allowed for that component at that time step. Then compare it with the soft target q. Although grid points outside the nearest neighbors have zero target probability, they still participate in the prediction probability normalization: if the model assigns more probability to distant grid points, the probability obtained by the nearest grid points will decrease, thereby increasing the cross-entropy.

[0151] When the number of grid points differs at different time steps, batch computation can fill in the grid point table length. These filler items are merely placeholders and do not represent actual coordinates; therefore, they are neither included in the nearest neighbor set nor participate in prediction probability normalization. The heading angle is represented by a numerical value within a defined interval, and the distance is calculated as the ordinary absolute difference between two angle values.

[0152] For a set of valid waypoints V with all components in a batch of samples, the cross-entropy of each component is calculated and weighted, as shown in equation (4). Where n is the sample index. , and For component weights.

[0153]

[0154] (4) In the above formula, , and These are pre-set hyperparameters used to adjust the contribution of each component to the total geometric soft label loss. These parameters can be manually preset with different positive weights according to the learning needs of each coordinate component. Let represent the soft target probability of the nth sample at the tth time step, the ath coordinate component, and the kth grid point, constructed by equation (3). The closer the distance, the greater the probability. The model predicts the probability, which represents the probability that the model predicts for the nth sample, the tth time step, the ath coordinate component, and the kth grid point. V represents the set of valid grid point indices; V represents the set of valid waypoints. This represents the soft-label cross-entropy loss calculated separately for the a-th coordinate component. This represents the total geometric soft-label cross-entropy loss.

[0155] In one embodiment, it is possible to take =1.3、 = =1; heading angle is omitted when only position is included. The above loss is the soft-label cross-entropy. Waypoints missing necessary components are not included in the average.

[0156] To maintain the weight of trajectory supervision, waypoint-specific terms are assigned a weight ω, while other effective terms have a weight of 1. Let I be the position of the effective term participating in sequence supervision. For target word, For the corresponding weights, calculate the weighted cross-entropy according to Equation (5) and combine it with the soft label loss.

[0157]

[0158] (5) In the above formula, represents the waypoint lexical weighted cross-entropy loss, which is the cross-entropy calculated by weighting the lexical units involved in sequence supervision; j represents the effective lexical position index; This represents the weight of the j-th word element, which is the weight of the target word element; This represents the target word element at position j, also known as the target word element. θ represents the probability that the model predicts the target word y_j at the j-th position given the preceding context, and θ is the model parameter; This indicates the total loss from monitoring and fine-tuning; The weighting coefficients represent the geometric soft-label cross-entropy loss, used to balance the sequence cross-entropy and the geometric soft-label cross-entropy.

[0159] Waypoint-specific terms include trajectory start and end terms and coordinate component terms; fill position and image placeholder terms are not included in the sequence loss. S21 contains two consecutive supervised steps: first, learning waypoint encoding and regularized motion semantics, and then learning visual scene description and preference-related planning criteria. A set of implementation parameters is as follows: first-stage learning rate 2×10⁻⁶. -5 λ = 0.1, ω = 1; Second-stage learning rate 1 × 10⁻⁶ -5 λ = 0.3, ω = 3; 3 rounds of training in each of the two phases.

[0160] To improve the distribution of motion categories, seven types of trajectory sampling were used in the first supervision phase. The change in the direction angle between adjacent trajectory segments was corrected to […]. The values ​​are accumulated after π, π; the absolute cumulative turning angle is less than 0.1 radians for straight driving, 0.1 to less than 0.4 radians for gentle curves, and not less than 0.4 radians for sharp curves. Positive and negative signs distinguish left and right. The straight driving trajectory is calculated by the ratio of the average speed of the second half to the average speed of the first half. A ratio greater than 1.2 indicates acceleration, less than 0.8 indicates deceleration, and the rest indicates constant speed. If the speed in the first half is less than 0.5 meters per second, and the speed in the second half is greater than 1 meter per second, it is considered acceleration; otherwise, it is considered constant speed.

[0161] Let non-empty class r have There are S samples and a total sample size of S, with class frequencies. = / S; Temperature and category adjustment coefficient Jointly determine the sampling probability Single sample weights As shown in equation (6).

[0162]

[0163]

[0164] In the above formula, This represents the sampling probability of category r, indicating the probability that a sample of that category will be selected during sampling. This represents the category adjustment factor for category r, used to add extra weight to a specific category; This represents the class frequency of class r, which is the proportion of samples in that class to the total number of samples. This represents the single-sample weight of sample i belonging to category r; This represents the category adjustment factor for category u; Represents the class frequency of category u; This represents the temperature parameter, specifically the temperature T in the category-frequency power transform. The subscript s is used to distinguish it from other temperature parameters.

[0165] Pick =2 can reduce the probability difference between high-frequency and low-frequency categories; one embodiment takes the following for gentle right curves and sharp right curves. =1.3, and the rest are set to 1. Sampling with replacement is performed according to the obtained sample weights to increase the relative learning opportunities for low-frequency behaviors. In the second supervised phase, the pre-organized thought chain data distribution can be used for further training, without needing to repeat the sampling process.

[0166] Scene category supervision is performed in S21. It uses the driving observations prepared in S11 as input and the teacher category labels as targets to train the same model to predict simple or complex categories. Online category judgment is performed in S31.

[0167] (ii) Multi-preference reinforcement learning process S22 S22 continues reinforcement learning using the model parameters from S21. The model that has undergone supervised fine-tuning is used as the initial model for reinforcement learning. This indicates a shared strategy, where driving observations and preferences serve as conditions. Trajectory evaluation rules are set for efficiency, safety, and comfort preferences, respectively, and feedback from each preference sample updates the same set of parameters θ. Expert-supervised answers for different preferences can be the same; the preference differences in candidate trajectories are mainly formed by reinforcement learning of different reward objectives in this stage.

[0168] For the same driving observation and the same preferences, G structured trajectory planning results are sampled. Each planning result includes a scenario description, planning reasoning, and a ten-step trajectory answer. After decoding the answer, the no-fault collision score (NC) and the drivable area compliance score (DAC) are obtained by combining the simulation evaluation information of the corresponding scenario. The former reflects whether the trajectory-corresponding motion has resulted in a collision for which the vehicle should bear responsibility, and the latter reflects whether the motion complies with the drivable area constraints.

[0169] make The truncation is defined as [0, 1], and B is calculated according to formula (7). If the trajectory cannot be parsed, the required expert trajectory is missing, B < 0.25, or the trajectory smoothness index J ≥ 1.74, then the trajectory answer reward is 0; otherwise, the continuous reward is calculated according to the current preference.

[0170]

[0171] In the above formula, B represents the common gating value, which is used to determine whether the trajectory enters the reward calculation of the preferred branch; NC represents the no-responsibility collision score, which reflects whether the trajectory-corresponding motion has caused a collision that the vehicle should bear responsibility for; DAC represents the drivable area compliance score, which reflects whether the motion complies with the drivable area constraints. This is a truncation function that restricts the input value to the range [0,1].

[0172] In reward calculation and Let i represent the i-th future prediction position and the expert position, respectively, i = 1, ..., 10, and denote the current origin as . = = (0, 0).

[0173] (i) Efficiency preference. To prevent the model from obtaining high rewards by simply shortening the journey, the overall direction of progress is determined by the expert's endpoint. The longitudinal distance to the predicted endpoint is reduced by the lateral drift, and then normalized by the expert's longitudinal journey.

[0174]

[0175]

[0176]

[0177] in, e This is the overall forward direction reference vector determined based on the expert endpoint; a To predict the arrival amount of the endpoint along this reference direction; b = p 10 - ae This is the reference vector used to calculate the lateral drift at the endpoint; a This is the reference distance traveled by the expert along this reference direction to the endpoint; N prog This is the net progress indicator after deducting lateral drift and normalizing relative to the expert reference travel; its value can be less than 0 or greater than 1. "·" represents the vector dot product, and "‖·‖" represents the Euclidean norm.

[0178] ε is a stable parameter to prevent positive values ​​with a denominator of zero. It should be sufficiently small relative to the normal stroke scale. In this embodiment, it is taken as 10. 6 . λ lat The weight for lateral drift is deducted and is taken as a positive value; in this embodiment, it is 1. Increasing this weight will strengthen the penalty for lateral drift at the destination. This weight can be set according to the task's trade-off requirements for effective advancement and lateral drift. Taking a fixed expert route as a reference, shortening the route in the correct direction will reduce the net progress, while the increased path length due to detours will not directly improve this item.

[0179] (II) Safety Preference. Using the expert trajectory as a position reference, the local expert heading is determined by the central difference after incorporating the origin, and the final point uses backward difference. Position errors are considered. Decomposed into longitudinal components along the local heading and the lateral component perpendicular to the heading The weighted average error D is calculated according to formula (9).

[0180]

[0181] D This is the weighted average position error over ten future time steps, taken as a non-negative value, with the unit consistent with the position coordinates; in this embodiment, it is meters. The denominator 10 indicates the number of future positions participating in the averaging.

[0182] l i The 7 in / 7 represents the error scaling ratio used in this embodiment, i.e., the scaling ratio for lateral errors. d i Without scaling, for longitudinal error l i First divide by 7, then calculate the error modulus together. Therefore, lateral errors of the same value have a stronger impact on rewards. This ratio is a preset hyperparameter; when a strong constraint on lateral error is required, a ratio greater than 1 can be used, and the specific value can be set according to the relative importance of lateral deviation and longitudinal deviation. This amount is used to shape safety preferences with reference to expert trajectories and is used in conjunction with collision and drivable area evaluations.

[0183] (III) Comfort Preference. The ten-step predicted trajectory is concatenated with the origin. For each position, the local average of its own position and its adjacent positions is taken; for boundary positions, only existing neighboring points are used. Then, a second-order difference is performed on the smoothed trajectory positions, and the root mean square J of the difference vector magnitude is used as the trajectory smoothness evaluation index. Let the smoothed position be... The displacement length of adjacent time steps is Its standard deviation is The calculation is as follows.

[0184]

[0185]

[0186]

[0187] The first value is obtained by performing a local average on the sequence consisting of the current origin and ten predicted positions. i A smooth position, i =0, ...,10. This sequence has 9 positions where the internal second-order difference can be computed, therefore... J Calculated based on the root mean square of the nine terms.

[0188] s i For the first i The displacement length of adjacent time steps i =1, ...,10; This is the arithmetic mean of the 10 displacement lengths; σ s This represents the overall standard deviation calculated based on 10 items. J With σ s All values ​​are non-negative, and their units are consistent with the position coordinates. The values ​​9 and 10 in the formula are determined by the number of trajectory points in this embodiment, and are not separately set reward weights.

[0189] Under a fixed time interval, σ s It reflects the fluctuation in displacement length between adjacent time steps. J It reflects the smoothness of local positional changes. After exponentially mapping the two, the geometric mean is taken, so that the comfort feedback takes into account both local changes and overall displacement rhythm.

[0190] After joint gating, the reward for the three preferences is calculated according to formula (11).

[0191]

[0192]

[0193]

[0194] in, R eff , R safe , R comfort The rewards for trajectory answers under efficiency, safety, and comfort preferences are respectively, all of which are within [0, 1]; exp represents an exponential function with the natural constant as the base.

[0195] The 1.2 in the efficiency reward is a positively normalized metric for net progress. When N prog When it reaches 1.2, the truncated progress mapping item reaches 1; when N prog When ≤0, the mapping term is 0.

[0196] The 0.8 in the security reward is related to... D A positive decay scale of the same dimension controls the intensity of the effect of position error on reward. 1.74 and 0.5 in the comfort reward are respectively... J σ s A positive decay scale of the same dimension controls the intensity of the impact of local trajectory changes and displacement length fluctuations on the reward. This embodiment will... J The decay scale and the aforementioned smoothness gating threshold are both set to 1.74.

[0197] The above scales can be set according to task requirements and the distribution of corresponding evaluation quantities. The smaller the decay scale, the more significant the decrease in reward caused by the same error or fluctuation. When setting other values, all scales should be positive, and the ratios in the exponent should be dimensionless. The three preferences respectively reflect the trade-offs between effective propulsion, reference position deviation, and motion smoothness.

[0198] (III) Process Rewards and Parameter Updates In addition to rewarding the trajectory answer, a large language model evaluation mechanism, namely LLM-as-Judge, is used for scene descriptions. This embodiment uses Qwen-3.6-Plus as the evaluation model, taking the current multi-view driving images and the generated descriptions as input to evaluate the factual accuracy and completeness of road structure, traffic lights, traffic participants, obstacles, and other key driving information.

[0199] The evaluation score is 0, 1, or 2: 0 indicates a serious lack of key information, obvious hallucinations, or content inconsistent with the image; 1 indicates the main scene is basically correct, but some key information is missing or partially inaccurate; 2 indicates key driving information is complete and correctly described. Divide the score by 2 to get a description reward of 0, 0.5, or 1.

[0200] The format-based reward system evaluates the completeness of the description, thinking, and answer sections, as well as whether the answer can extract the expected waypoint structure. A reward of 1 is given when all three sections are complete and the answer passes structure parsing; 0.5 is given when the answer exists but the overall structure is incomplete, or when all three sections are complete but the answer fails structure parsing; otherwise, a reward of 0 is given.

[0201] Inference utility rewards can also be enabled to evaluate whether generative inference enhances the model's support for rational actions. For the same expert waypoint answer, the average log probability of each word in the expert answer is calculated, both with and without generative inference provided. During the calculation, the preceding words of the expert answer are provided sequentially, and the model's predicted probability for the current expert word is measured; this process is used for training evaluation, and the expert answer is not used as input for online planning.

[0202] Let U represent driving observations, navigation, and preference conditions, and H represent generative reasoning. Let j be the j-th word in the expert answer, with length L. Its likelihood difference and mapping are given by equation (12).

[0203]

[0204]

[0205] in, This represents the conditional lexical probability given by a visual language action model with parameter θ. This indicates that the expert answer is located at the [number]th [position]. jThe lexical sequence preceding each lexical unit, j When = 1, the sequence is empty; L The total number of tokens in the expert's answer is a positive integer; log represents the natural logarithm.

[0206] Δ This is the difference in the average conditional log probability of the model for the same expert answer before and after incorporating generative inference. A larger value indicates that generative inference enhances the model's support for the expert answer. z The continuous inference utility score is obtained by mapping with the Sigmoid function, and its value is in the range (0, 1).

[0207] κ is a positive mapping sensitivity coefficient, which is set to 1 in this embodiment. Increasing κ will cause the same positive and negative likelihood differences to be mapped to fractions closer to 1 and 0, respectively.

[0208] This embodiment uses 0.5 and 0.75 as the grading thresholds: z The reward is 0 when <0.5, and 0.5≤ z When the value is less than 0.75, the reward is 0.5. z The reward is 1 when ≥0.75. Therefore, Δ =0 corresponds to z =0.5, the reward is 0.5. The above mapping coefficients and tiered thresholds are preset parameters; if a threshold is set separately, it should be kept within (0,1) and increase incrementally.

[0209] A group-relative strategy is employed to optimize GRPO for reinforcement learning: G planning outcomes are generated for the same observation and preference, with the relative quality of outcomes within the same group providing an advantage signal, thereby increasing the probability of generating a better planning outcome. G=8 represents sampling 8 planning outcomes, each containing a ten-step trajectory.

[0210] For multiple rewards, a GDPO method with channel-based group normalization is adopted. Let... This represents the c-th reward channel value for the i-th planning result in the same group. and This represents the mean and standard deviation of this channel in the group; first normalize by channel, then normalize by weight. Aggregate and normalize the aggregated values ​​in the training batch.

[0211]

[0212]

[0213] in and The mean and standard deviation of the batch aggregate values. =10 -4 , =10-5 The weights for the answer, description, and format channels are 3, 1, and 1, respectively; a channel with a weight of 1 is added after inference utility is enabled. Channel normalization can reduce the impact of reward scale differences; channels with the same value within a group do not provide relative superiority or inferiority signals.

[0214] The relative feedback of the group is used as the reward at the end of the structured trajectory planning result generation, and a word-level KL constraint relative to the reference strategy is added to form an advantage acting on the generated words. The strategy is updated based on the word probability ratio between the current strategy and the sampling-related strategy, and the probability ratio is pruned to limit single policy changes. When asynchronous sampling exists, the difference between the sampling strategy and the strategy before the update is further corrected by the importance ratio. One configuration uses a pruning coefficient of 0.2 and a reference strategy constraint coefficient of 0.03. Here, KL is used for reinforcement learning policy constraints, and the geometric soft label loss for supervised fine-tuning is still calculated based on cross-entropy.

[0215] Third, the reasoning stage In S31, the model outputs the scenario category based on the current observation. Situations where the road is clear, there is little interaction among traffic participants, and stable travel along the current road can be classified as simple scenarios; situations requiring the weighing of multiple decisions, such as intersections, lane changes or merging, pedestrian and vehicle interactions, and obstacle avoidance, can be classified as complex scenarios.

[0216] In S32, for simple scenarios, preset preferences, such as safety preferences, are used, and the model generates a planning result that includes a scenario description, planning reasoning, and waypoint answers. For complex scenarios, while maintaining consistency between driving observations and model parameters, efficiency, safety, and comfort preference prompts are added respectively, generating three candidate results, which are then associated with and saved with candidate identifiers. The three conditions can be organized as batch inputs, using the same format to complete candidate generation.

[0217] In S33, for the three candidates generated in a complex scenario, the current driving observation, candidate identifiers, and the answers to each candidate trajectory are input into the same model. The model is required to compare aspects such as collision avoidance, road traffic requirements, driving progress, and motion smoothness, and output the selected identifier and a brief reason for selection. In S34, the waypoint answer of the selected result is read based on the identifier, the number of coordinate terms, time steps, and component identifiers are verified, and the start and end identifiers when enabled are checked; the coordinates are restored according to formula (1) to obtain the N-step target trajectory arranged by time. In this embodiment, N=10; a single result of a simple scenario directly enters S34.

[0218] In an alternative implementation, candidate selection can also be accomplished by an independent scoring network that fuses image features, candidate locations, and vehicle speed, using the simulation planning evaluation score as the regression training objective. The main implementation described above employs the same VLA (Visual Language Action Model) for selection.

[0219] Fourth, application and effectiveness verification of autonomous driving tasks. To verify the effectiveness of the method in autonomous driving applications, Qwen3-VL-4B was used as the base model. Multi-view images, vehicle status, and navigation commands were input, and the model was trained after supervised fine-tuning and reinforcement learning. The results were evaluated on the NAVSIM navtest task and the Bench2Drive closed-loop task. The experiment used two coordinate units (X and Y) for each step to generate a ten-step trajectory for the next 5 seconds at 0.5-second intervals.

[0220] The training data includes 200,000 sets of images and expert trajectory samples, of which 170,000 sets are from nuPlan and 30,000 sets are from nuScenes; an additional 30,000 structured inference samples and 15,000 reinforcement learning inputs are used, with each set having a sampling G=8. This data is used for waypoint representation learning, structured output supervision, and multi-preference reinforcement learning, respectively.

[0221] 1. Training effect verification The performance of comprehensive trajectory planning in NAVSIM was evaluated using PDMS, with higher scores being better. In representation ablation with the same base model, data, and supervised fine-tuning budget, the PDMS score for joint 2D lexical units was 66.92, 71.93 with temporal index but no geometric soft supervision, and 80.96 with complete temporal component encoding and geometric soft supervision, supporting the joint modeling of temporal, component, and geometric relationships. Table 2 further compares the post-training configurations.

[0222] Table 2 Comparison of NAVSIM Training Configurations

[0223] Structured reasoning supervision improved the score by 2.72 points compared to waypoint supervision; complete reward improved the score by 2.09 points compared to answer-only reward, indicating that structured supervision and process reward can improve planning performance under the corresponding experimental conditions.

[0224] 2. Inference Effects and Computational Costs Using the same reinforcement learning model, the single-result process adopts a preset preference; the multi-candidate process generates efficiency, safety, and comfort results respectively, and then the model selects the result. Adaptive inference determines the scene category by the model. In navtest, 56.22% of the scenes entered the multi-candidate process, and the results are shown in Table 3.

[0225] Table 3 Comparison of NAVSIM Inference Methods

[0226] Latency was measured on a single NVIDIA H800 with a batch size of 8, including scene description, planning inference, and waypoint answer generation. The multi-candidate process also includes candidate selection. The adaptive process was 0.29 PDMS score points lower than the always-multi-candidate process, with an average latency reduction of approximately 1.85 seconds. This measurement corresponds to a 0.2 Hz long-term planning setting; a 0.5-second waypoint interval in the trajectory does not indicate that the model completes replanning at the same interval.

[0227] On the same three-preference candidate set, the PDMS of random selection was 88.62, and that of selection within the same VLA was 92.42. Additionally, three trajectories were sampled for each single preference, and post-hoc scoring was used for selection, with the highest PDMS being 91.67. This control demonstrates that the multi-preference benefit in this experiment outweighs the increased sampling frequency of single-preference selection; post-hoc scoring was only used for the control, while online selection used both observations and candidate outputs. The control maintained the same number of candidates, and in-model selection consumed an additional model computation.

[0228] 3. Closed-loop driving task verification In the Bench2Drive interactive closed-loop task, the overall driving performance was evaluated by the Driving Score and the task success rate was represented by the SuccessRate. The higher both scores were, the better. The results are shown in Table 4.

[0229] Table 4 Comparison of Bench2Drive Closed-Loop Tasks

[0230] The results from Orion and AutoVLA are cited from their papers or public leaderboards and were not reproduced in this experiment. The Driving Score of this embodiment is the highest among the listed methods, with a success rate between the two reference methods. The above closed-loop results, together with the internal comparison with NAVSIM, illustrate the effectiveness of temporal waypoint representation, structured post-training, and in-model candidate selection in the corresponding autonomous driving tasks.

[0231] In another embodiment of this application, an electronic device is also provided, including a memory and a processor. The memory stores a grid configuration, waypoint lexical mappings, model parameters, and a computer program. When the processor executes the computer program, it implements the aforementioned training method and / or inference method. The training device and the inference device may be the same electronic device or different electronic devices.

[0232] In another embodiment of this application, a computer-readable storage medium is also provided, on which a computer program is stored. When the computer program is executed by a processor, it implements the above-described training method and / or inference method.

[0233] Specifically, the computer-readable storage medium includes, but is not limited to, read-only memory, random access memory, optical disk, magnetic disk, flash memory, etc. The computer program can be executed by a processor to implement training preparation steps, supervised fine-tuning steps, reinforcement learning steps, and inference phase steps such as scene judgment steps, trajectory result generation steps, candidate selection steps, and trajectory decoding steps.

[0234] It should be noted that the storage medium can also store grid configurations, waypoint terminology mappings, and model parameters for the processor to read when executing programs.

[0235] The embodiments described above in this application store computer programs on computer-readable storage media, enabling the processor to implement the above-described training and inference methods when executing the programs, thus facilitating the deployment and dissemination of the methods.

[0236] Optionally, the memory is used to store programs; the memory may include volatile memory, such as random-access memory (RAM), such as static random-access memory (SRAM), double data rate synchronous dynamic random-access memory (DDR SDRAM), etc.; the memory may also include non-volatile memory, such as flash memory. The memory is used to store computer programs (such as application programs and functional modules that implement the above methods), computer instructions, etc., and the aforementioned computer programs and computer instructions can be partitioned and stored in one or more memories. Furthermore, the aforementioned computer programs, computer instructions, data, etc., can be accessed by the processor.

[0237] The aforementioned computer programs, computer instructions, etc., can be stored in partitions within one or more memory locations. Furthermore, the aforementioned computer programs, computer instructions, data, etc., can be accessed by a processor.

[0238] A processor is used to execute a computer program stored in memory to implement the various steps of the methods involved in the above embodiments. For details, please refer to the relevant descriptions in the preceding method embodiments.

[0239] The processor and memory can be separate structures or integrated structures. When the processor and memory are separate structures, they can be coupled together via a bus.

[0240] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0241] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0242] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0243] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0244] The foregoing has described some specific embodiments of this application. It should be understood that this application is not limited to the specific embodiments described above, and those skilled in the art can make various modifications or variations within the scope of the claims, which do not affect the substantive content of this application. The above-described preferred features can be used in any combination without conflict.

Claims

1. A method for training a trajectory planning model based on temporal waypoint encoding and preference adaptation, characterized in that, include: Training preparation steps: Acquire multi-view driving images, vehicle speed, navigation commands, and corresponding expert future trajectories; The expert trajectory is coded into waypoints at N future time steps with uniform time intervals. A grid and word mapping are established to obtain a waypoint word sequence. Each waypoint word identifies its time step, coordinate components, and coordinate grid index. Supervision data is constructed, which includes waypoint answers composed of the waypoint word sequence and category supervision data of simple or complex scenarios labeled by the teacher model. Supervised fine-tuning step: Weighted sampling of training samples containing the supervised data according to the motion category of the expert trajectory; Using the expert trajectory as a reference, geometric soft tags are constructed. The cross-entropy loss of geometric soft tags and the cross-entropy loss of waypoint lexical weights are combined to supervise and fine-tune the visual language action model. The scene judgment ability of the visual language action model is trained using the category supervision data with multi-view driving images, vehicle speed and navigation instructions as inputs. Reinforcement learning steps: Sample multiple structured trajectory planning results based on multi-view driving images, vehicle speed, navigation instructions, and efficiency, safety, or comfort preferences; For each structured trajectory planning result, the trajectory reward and process reward corresponding to its preference conditions are calculated, and the shared parameters of the visual language action model are optimized and updated using a group relative strategy; wherein, the sample feedback corresponding to different preferences jointly updates the same set of shared parameters; the structured trajectory planning result includes at least waypoint answers.

2. The training method according to claim 1, characterized in that, The waypoint codes include: For each time step and each coordinate component, the value range, grid interval and number of discrete grid points are set, each grid point corresponds to a coordinate representative value, and an independent word set is established for each coordinate component of each time step; The grid index is obtained by dividing the offset of the component values ​​of the expert trajectory relative to the lower bound of the grid by the grid interval, rounding to the nearest integer and limiting it to the valid index range; The waypoint lexical sequence is obtained by concatenating the lexical units of each coordinate component in chronological order; the same grid and lexical mapping are used for training, generation and decoding.

3. The training method according to claim 2, characterized in that, The supervisory data also includes scenario descriptions and planning reasoning text, the construction and use of which include: Based on the expert trajectory and current vehicle speed, motion facts are extracted. Multi-view driving images, vehicle speed, navigation instructions, the motion facts, and specified preferences are input into the teacher model to generate scene descriptions and planning basis. The planning basis and the motion facts are combined into planning reasoning text, and the expert trajectory is encoded into waypoint answers according to the grid and word mapping. For different preference samples constructed using the same expert trajectory, the same waypoint answer is used, and the difference in preference is reflected in the difference in input conditions and planning reasoning text; In the supervised fine-tuning step, the multi-view driving images, vehicle speed, navigation instructions and specified preferences are used as inputs, and the scene description, planning reasoning text and waypoint answers are used to form the target output sequence. The sequence cross-entropy loss is calculated for the effective words involved in the supervision.

4. The training method according to claim 1, characterized in that, The weighted sampling includes: Based on the signed cumulative turning angles of the expert trajectory, the samples are divided into straight or turning categories. The straight category is further divided into acceleration, deceleration or constant speed according to the speed changes in the first and second halves. The turning category is further divided into gentle curve or sharp curve according to the size of the cumulative turning angle, resulting in seven categories: straight constant speed, straight acceleration, straight deceleration, left gentle curve, left sharp curve, right gentle curve and right sharp curve. Apply a temperature power transform and a category adjustment coefficient to the sample frequencies of each category to obtain the sampling probabilities of each category; The individual sample weight is determined based on the sampling probability and sample size of each category, and the samples are sampled with replacement according to the individual sample weight.

5. The training method according to claim 1, characterized in that, The construction of the geometric soft tag includes: For the same time step and the same coordinate component, calculate the absolute difference between the coordinate representative value and the expert component value of each effective grid point, and select at most K grid points with the smallest absolute difference to form a nearest neighbor set; The probability of a soft target within the set is obtained by dividing the negative absolute difference of each grid point in the nearest neighbor set by the temperature parameter of the corresponding component and then performing exponential normalization. The probability of a soft target for grid points outside the nearest neighbor set is zero. The model prediction probability is normalized across all valid grid points of the same component at the same time step.

6. The training method according to claim 5, characterized in that, The loss calculation in the supervised fine-tuning step includes: Calculate the soft label cross-entropy for each coordinate component separately, average it over the effective waypoints and sum it according to the component weights to obtain the geometric soft label cross-entropy loss; Weights are assigned to the lexical units involved in sequence supervision, making the weights of waypoint-specific lexical units greater than the weights of ordinary text lexical units, and the sequence cross-entropy is normalized by the sum of the effective lexical unit weights. The sequence cross-entropy and the geometric soft-label cross-entropy loss are weighted and combined to form the supervised fine-tuning loss.

7. The training method according to claim 1, characterized in that, The calculation of the trajectory reward includes common gating and preference branching: The product of the no-fault collision score and the drivable area compliance score is combined with the trajectory smoothness condition for joint gating. The trajectory reward for failing the gating is zero. When passing through gating, efficiency preference determines the net progress reward based on the predicted destination's distance along the expert's overall direction of travel, the destination's lateral drift, and the expert's reference travel distance; safety preference determines the reward based on the weighted error of the predicted trajectory's lateral and longitudinal components relative to the expert's trajectory; comfort preference determines the reward based on the trajectory smoothness index and the fluctuation of displacement length in adjacent time steps.

8. The training method according to claim 7, characterized in that: The calculation of the reward for the safety preference includes: decomposing the predicted position error into longitudinal and lateral components along the expert local heading, calculating the average displacement error in a weighted manner with the lateral weight greater than the longitudinal weight, and mapping it to the reward through exponential decay. The calculation of the comfort preference reward includes: averaging the predicted trajectory including the origin, calculating the root mean square of the second-order difference vector magnitude of the smoothed position as the trajectory smoothness index; calculating the standard deviation of the displacement length of adjacent time steps; and taking the geometric mean after exponentially mapping the trajectory smoothness index and the standard deviation to obtain the comfort preference reward.

9. The training method according to claim 1, characterized in that, The structured trajectory planning results also include scene descriptions and planning reasoning text; The group relative strategy optimization includes: For the same multi-view driving image, vehicle speed, navigation command and the same preference, sample multiple structured trajectory planning results, and calculate the trajectory answer reward, scene description reward, format reward and reasoning utility reward for each planning result respectively; Each reward channel is group normalized separately, aggregated by weight, and then batch normalized to obtain the advantage estimate. The shared parameters are then updated by combining the reference policy constraint and policy probability ratio pruning. The reasoning utility reward is determined based on the difference in the average conditional log-likelihood of the model's answer to the same expert waypoint, given and without the provision of generated reasoning text.

10. A trajectory planning reasoning method based on temporal waypoint encoding and preference adaptation, characterized in that, Input the current multi-view driving images, vehicle speed, and navigation commands into the visual language action model trained by the training method described in any one of claims 1 to 9, and perform the following steps: Scene determination step: The model outputs a simple or complex scene category based on the current multi-view driving images, vehicle speed, and navigation instructions; Trajectory result generation steps: For simple scenarios, a single structured trajectory planning result is generated using preset preferences; For complex scenarios, while keeping the input multi-view driving images, vehicle speed, navigation commands and model parameters the same, multiple candidate planning results are generated using efficiency preference, safety preference and comfort preference respectively. The structured trajectory planning results and candidate planning results include at least waypoint answers. Candidate selection step: For complex scenarios, the current multi-view driving image, vehicle speed, navigation instructions, candidate icons, and waypoint answers from the multiple candidate planning results are input into the model. The model then outputs the selected candidate icons based on collision avoidance, road traffic requirements, driving progress, and motion smoothness. For simple scenarios, the single structured trajectory planning result is determined as the selected result; Trajectory decoding steps: According to the grid and word mapping established by the training method, decode the waypoint answers in the selected results to obtain the target trajectory.

11. The reasoning method according to claim 10, characterized in that, The trajectory decoding step includes: Check the length, time step identifier, and coordinate component identifier of the selected waypoint answer, and check these two types of identifiers when the waypoint answer includes a start identifier and an end identifier; Extract the grid index of each waypoint term and recover the coordinate components of N future time steps according to the corresponding grid lower bound and grid interval; Output the target trajectory in chronological order.

12. An electronic device comprising a memory and a processor, characterized in that, The memory stores the grid configuration, waypoint lexical mapping, model parameters, and computer program. When the processor executes the computer program, it implements the trajectory planning training method of temporal waypoint encoding and preference adaptation as described in any one of claims 1 to 9, and / or the trajectory planning inference method of temporal waypoint encoding and preference adaptation as described in any one of claims 10 to 11.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the trajectory planning training method of temporal waypoint encoding and preference adaptation as described in any one of claims 1 to 9, and / or the trajectory planning inference method of temporal waypoint encoding and preference adaptation as described in any one of claims 10 to 11.