Paper · Agents and tools · Version 1
TransitSim-LLM: a closed-loop framework for GTFS-driven transit service evaluation using open-source LLMs and SUMO microsimulation
First published: Frontiers in Future Transportation, . Original
Copyright the authors. Licensed under Creative Commons Attribution 4.0 International.
This page holds the text of the paper, converted to HTML; figures may be left out.
A framework that combines public transit timetable data, open-source language models and a traffic simulator. It helps small transit agencies find service problems, propose fixes and test them in simulation before acting.
Abstract
Introduction
Resource-constrained transit agencies face challenges in translating service data into actionable interventions and evaluating their operational consequences.
Methods
This study develops TransitSim-LLM, an integrated framework combining General Transit Feed Specification (GTFS) diagnostics, large language model (LLM) reasoning, and Simulation of Urban Mobility (SUMO) microsimulation. The framework integrates seven service diagnostics, issue prioritization, validated intervention generation, comparative simulation, and planning interpretation. It was evaluated using the MyBas network in Johor Bahru, Malaysia.
Results
The analysis covered 21 routes and 271 stops, identifying four principal service concerns. Two intervention scenarios satisfied five predefined technical validation criteria. The frequency-enhancement scenario increased completed vehicle trips by 5.2%, reduced the reported waiting-time indicator by 6.2%, and increased vehicle kilometers by 5.8%. Benchmarking four openly available LLMs yielded diagnostic quality scores of 85/100 for three Llama models. LLM-generated scenarios achieved higher rubric-based quality scores (80-86) than rule-based (43) and random (25) alternatives.
Discussion
TransitSim-LLM demonstrates the potential of integrating structured transit diagnostics, LLM-assisted intervention generation, and microsimulation for evidence-informed transit planning. However, observed passenger-demand data and operational feasibility assessments remain necessary before real-world implementation.
Keywords: generative artificial intelligence, GTFS, large language models, public transit planning, SUMO microsimulation, transit service evaluation, transportation decision support
1 Introduction
Public transit is fundamental to urban mobility in developing countries, where substantial populations depend on affordable and reliable services for daily travel (Ceder, 2016; Iles, 2005). In Southeast Asia, rapid urbanisation, motorisation, and institutional resource constraints have intensified the challenges of maintaining accessible and efficient transit networks (Cervero and Golub, 2007). Conventional transit performance evaluation combines operational indicators, field observations, passenger surveys, geographic information systems, and analytical or simulation-based models to assess service frequency, reliability, accessibility, and travel time (Ceder, 2016; Cats et al., 2016; Ibarra-Rojas et al., 2015). Although these approaches provide established and interpretable measures of service quality, comprehensive assessments often require specialised expertise, reliable operational data, and substantial analytical resources. Translating diagnostic findings into feasible interventions and evaluating their consequences introduce additional challenges, particularly for transit agencies with limited technical capacity.
The General Transit Feed Specification (GTFS) provides a standardised representation of public transit routes, stops, scheduled trips, service calendars, and fare information (Eros et al., 2014; Antrim and Barbeau, 2013). Its interoperable structure facilitates computational service evaluation and integration with geographic and network analysis tools (Liu et al., 2025). Malaysia’s national open data portal provides GTFS datasets for multiple transit systems, including the MyBas bus network in Johor Bahru. However, data availability alone does not ensure effective service planning. Converting scheduled transit information into actionable insights requires analytical procedures that connect service diagnostics with intervention generation and performance assessment.
Microscopic traffic simulation evaluates transportation systems by representing individual vehicles and their interactions within a road network, including car-following, lane-changing, traffic control, and transit operations under specified conditions (Cats et al., 2016; Desta and Tóth, 2021). It provides a computational environment for examining alternative service configurations before implementation. Simulation of Urban Mobility (SUMO) is an open-source microsimulation platform supporting detailed road network modelling and public transit operations (Lopez et al., 2018; Krajzewicz et al., 2012). Nevertheless, preparing simulation inputs, formulating interventions, and interpreting operational trade-offs remain technically demanding. Recent advances in large language models (LLMs) offer opportunities to support these activities through structured information processing, analytical reasoning, and machine-readable output generation. Existing transportation applications have demonstrated their potential for GTFS information retrieval and computational analysis (Devunuri and Lehe, 2025; Devunuri et al., 2023; Jonnala et al., 2025; Wandelt et al., 2024; Hassan et al., 2025a), while related studies have explored LLM-assisted traffic simulation and scenario generation (Li et al., 2024; Jeong et al., 2025; Ye et al., 2025).
Despite these advances, GTFS-oriented LLM applications and simulation-based transportation workflows remain insufficiently integrated for transit-specific service evaluation. Existing approaches provide valuable capabilities for information retrieval, simulation configuration, or intervention generation, but the connection between structured transit diagnostics, context-aware scenario formulation, microsimulation, and interpretation of operational consequences requires further investigation. Moreover, the suitability of openly available LLMs for these interconnected tasks remains underexplored, particularly in resource-constrained transit planning contexts.
To address these gaps, this study proposes TransitSim-LLM, an integrated computational framework combining GTFS-based diagnostics, LLM-assisted reasoning, and SUMO microsimulation for transit service evaluation and intervention assessment. The framework identifies potential service deficiencies, generates and validates machine-readable interventions, evaluates their simulated operational consequences, and translates the findings into planning insights. Its application to the MyBas bus network in Johor Bahru, Malaysia, provides an empirical demonstration in a Southeast Asian urban transit context. Specifically, the study pursues three research objectives:
- RO1: To develop and assess an integrated GTFS–LLM–SUMO framework for identifying schedule-derived transit service deficiencies and generating technically valid, simulation-compatible interventions.
- RO2: To evaluate the operational effects of LLM-generated transit interventions through comparative microsimulation of baseline and alternative service configurations.
- RO3: To benchmark openly available LLMs for structured transit diagnostic tasks in terms of response quality, output consistency, and computational efficiency.
The study contributes to the literature by integrating transit diagnostics, LLM-assisted intervention generation, and simulation-informed interpretation within a unified analytical workflow; formalising the process through mathematical indicators, computational algorithms, and scenario validation procedures; providing empirical evidence on the diagnostic performance and computational requirements of openly available LLMs; and demonstrating the framework in a Southeast Asian public bus network. Together, these contributions advance the methodological integration of structured transit data, language-based analytical reasoning, and microsimulation for evidence-informed transit planning.
2 Literature review
2.1 GTFS-based transit service evaluation and planning
The General Transit Feed Specification (GTFS) is an open data standard for representing scheduled public transport operations through interconnected files containing routes, stops, trips, stop times, service calendars, route geometries, and fare information. Originally developed through a collaboration between Google and TriMet, GTFS has become widely adopted for exchanging transit information and supporting computational transportation analysis (Antrim and Barbeau, 2013). Its standardised structure enables integration with geographic information systems, network analysis methods, and transit planning tools, facilitating the assessment of spatial and temporal service characteristics.
Previous studies have demonstrated the analytical value of structured transit information across multiple planning dimensions. El-Geneidy et al. (2014) investigated walking distances to transit stops to identify spatial redundancies and accessibility gaps, while (Welch and Mishra, 2013) examined equity in public transit connectivity. Kieu et al. (2015) investigated public transport travel time variability, highlighting the importance of temporal service characteristics. These contributions establish the relevance of spatial accessibility, network connectivity, and temporal performance in transit evaluation. However, static GTFS describes scheduled service provision and does not independently establish observed passenger demand, actual vehicle operations, or experienced service reliability.
Transit service evaluation also has an established methodological foundation in operational performance measurement and network planning. The Transit Capacity and Quality of Service Manual provides guidance for assessing service frequency, availability, travel time, and reliability (Transportation Research Board, 2013). Walker (2024) emphasised the importance of frequency and predictable service intervals, while Hensher et al. (2010), dell’Olio et al. (2011), Redman et al. (2013) examined the influence of service attributes on passenger experience and travel behaviour. At the network level, (Currie, 2010) investigated spatial gaps in transit supply relative to social needs. These studies demonstrate that transit performance encompasses both operational characteristics and passenger-oriented service quality.
Transit network design and scheduling have further been examined through mathematical programming, network analysis, and simulation-based approaches (Farahani et al., 2013; Guihaire and Hao, 2008; Mandl, 1980). Microsimulation enables proposed operational modifications to be assessed under specified network and traffic conditions (Cats et al., 2016). Nevertheless, improved service frequency or coverage may require additional vehicle-kilometres, fleet resources, and operating expenditure. Consequently, intervention assessment requires consideration of multiple performance indicators and operational trade-offs rather than reliance on a single service measure.
Despite the availability of established evaluation methods, integrating heterogeneous transit data, identifying actionable service issues, and assessing alternative interventions frequently require specialised analytical expertise (Ibarra-Rojas et al., 2015). These requirements are particularly relevant to developing-country transportation systems, where urbanisation, motorisation, institutional fragmentation, and resource constraints complicate transit planning (Almselati et al., 2011; Nguyen et al., 2019; Muromachi et al., 2015). The increasing availability of GTFS datasets in Southeast Asia therefore creates opportunities for more accessible computational workflows that connect structured service diagnostics with intervention assessment.
2.2 LLMs in transportation analytics and traffic simulation
Large language models (LLMs) are computational models trained on extensive datasets to learn representations of language and generate contextually relevant outputs. Contemporary LLMs commonly employ transformer architectures, which use attention mechanisms to capture relationships within input sequences (Vaswani et al., 2017). Through pretraining and subsequent adaptation, these models support information extraction, question answering, code generation, and structured analytical tasks (Brown et al., 2020; Zhao et al., 2023). Their ability to process structured information and generate machine-readable outputs offers opportunities for integration with transportation analysis and decision-support systems.
Recent transportation research has examined LLM applications in mobility information processing and computational analysis (Wandelt et al., 2024). Devunuri and Lehe (2025) introduced TransitGPT, which uses GPT-4 to generate Python code for querying GTFS datasets through natural language interactions. Devunuri et al. (2023) benchmarked LLM performance on GTFS understanding and retrieval tasks, highlighting differences in model capabilities and instruction following. Similarly, Jonnala et al. (2025) investigated LLM-assisted public transportation information retrieval using the San Antonio transit system. Collectively, these studies demonstrate the potential of LLMs to facilitate interaction with structured transit information. However, information retrieval and code generation do not independently establish the validity of identified service deficiencies or the operational suitability of proposed interventions.
The integration of LLMs with traffic simulation has introduced additional opportunities for automating scenario specification and computational workflows. Li et al. (2024) developed ChatSUMO to translate natural language descriptions into SUMO-compatible simulation configurations. Jeong et al. (2025) introduced AgentSUMO, incorporating LLM-guided simulation interactions and iterative intervention refinement, while Ye et al. (2025) proposed SUMO-MCP to connect SUMO functionality with LLM-based workflows through structured tools. These developments demonstrate the feasibility of linking language-based reasoning with simulation software, although their primary emphasis differs from integrated GTFS-driven transit service evaluation.
Transit-specific simulation requires explicit representation of scheduled departures, route alignments, stop sequences, service frequency, and operational performance indicators. Connecting these elements with LLM-generated interventions therefore requires a consistent relationship between the original GTFS configuration, proposed service modifications, and simulation inputs. Furthermore, technical scenario validity must be distinguished from operational feasibility, since a machine-readable intervention does not necessarily satisfy fleet, labour, or financial constraints.
The accessibility of LLM-based analytical workflows is another important consideration. Openly available model families, including LLaMA, Mistral, and Qwen, provide alternatives to proprietary commercial models (Touvron et al., 2023; Jiang et al., 2023; Bai et al., 2023). However, model availability alone does not establish suitability for transit planning. Diagnostic quality, quantitative grounding, structured output compliance, response consistency, and computational requirements must also be examined to assess their applicability to interconnected analytical tasks.
2.3 Research gap and study positioning
The reviewed literature establishes complementary advances in GTFS-based transit evaluation, LLM-assisted transportation analytics, and traffic simulation. However, three interconnected research gaps remain.
First, existing GTFS-oriented LLM applications have primarily addressed information retrieval and structured data processing, whereas LLM-assisted simulation frameworks have focused on simulation configuration and traffic-oriented computational workflows. Their integration into a transit-specific analytical pipeline connecting schedule-derived diagnostics, intervention generation, microsimulation, and performance interpretation remains insufficiently examined. Such integration requires transparent procedures that link identified service issues with proposed modifications and their simulated operational consequences.
Second, the suitability of openly available LLMs for structured transit diagnostic and intervention-oriented tasks requires further empirical assessment. Performance in information retrieval or code generation does not necessarily establish diagnostic consistency, contextual reasoning quality, or compliance with simulation-compatible output requirements. Comparative evaluation of response quality, consistency, and computational efficiency is therefore important for understanding their applicability to transit planning workflows.
Third, integrated LLM-assisted transit evaluation remains underexplored in Southeast Asian urban bus networks, where data availability, institutional capacity, and operating conditions may differ from those represented in existing applications. Empirical examination in such contexts can provide evidence regarding the applicability and limitations of computational approaches developed for structured transit service assessment.
TransitSim-LLM addresses these gaps by integrating GTFS-based diagnostics, LLM-assisted issue prioritisation, structured intervention generation, SUMO microsimulation, and simulation-informed interpretation within a unified framework. Its application to the MyBas bus network in Johor Bahru, Malaysia, demonstrates the workflow in a Southeast Asian transit context, while comparative benchmarking examines the diagnostic performance and computational requirements of openly available LLMs. The study thereby extends existing research from isolated information-processing and simulation tasks toward an integrated approach for examining scheduled transit services and alternative operational configurations.
3 Methodology
TransitSim-LLM integrates five analytical phases: (1) GTFS-based service diagnostics, (2) LLM-assisted issue identification and prioritisation, (3) intervention generation and validation, (4) SUMO microsimulation, and (5) simulation-informed results interpretation. The framework connects scheduled transit service characteristics with potential interventions and their simulated operational consequences. Figure 1 illustrates the overall architecture.
FIGURE 1 Overall architecture of TransitSim-LLM, integrating GTFS diagnostics, LLM-assisted reasoning, intervention generation and validation, SUMO microsimulation, and planning interpretation.
3.1 Framework architecture
The framework requires three principal inputs: a structured GTFS feed , a geographic bounding box B defining the study area, and an openly available LLM accessed through a cloud application programming interface (API). The number of intervention scenarios, k, is specified as an additional configuration parameter. The outputs comprise a comparative assessment of the generated scenarios, a scenario ranking , and a planning brief summarising the diagnostic findings, simulated performance changes, and operational trade-offs.
The GTFS feed is represented as , where denotes the transit routes, represents the stops, contains scheduled trips and associated temporal information, and represents the available fare attributes and rules. This notation provides an abstract representation of the feed rather than an exhaustive listing of its constituent files. The road network is represented as a directed graph , where V denotes network nodes, E represents directed road connections, and W assigns travel-time-based edge weights. The corresponding SUMO network, , is constructed from the road network extracted within B.
The analytical workflow begins by transforming into a structured diagnostic vector . The LLM interprets these indicators to identify potential service deficiencies and produce a prioritised issue set . The prioritised findings subsequently guide the generation of intervention scenarios, each specifying modifications to selected scheduled service attributes. Candidate scenarios undergo predefined technical validation before entering the simulation stage.
Let denote the validated scenario set, where represents the modified GTFS configuration under scenario . The baseline and intervention configurations are evaluated using the same SUMO network and consistently defined performance indicators. Their corresponding KPI vectors are denoted by and , respectively. This common evaluation structure enables comparison of service changes without introducing differences in the underlying road network representation.
The final phase uses the KPI vectors to assess scenario-level performance differences and generate a planning brief. The framework closes the analytical evidence loop by incorporating simulation outcomes into the interpretation of the proposed interventions. The feedback supports subsequent planning reconsideration but does not constitute an automatically repeated simulation-based optimisation process.
Algorithm 1 formalises the complete computational sequence. Candidate validation follows the five criteria defined in Section 3.4. If fewer than k valid scenarios are obtained, one regeneration attempt is permitted. The workflow proceeds to simulation only when the requested number of technically valid scenarios is available.
TransitSim-LLM Master Pipeline.
- Require: GTFS feed , bounding box B, LLM , scenario count k
- Ensure: Scenario ranking and planning brief , or validation failure
- 1: ⊳ Phase 1
- 2: ⊳ Phase 2
- 3: if then
- 4: return
- 5: end if
- 6: ⊳ Phase 3
- 7: if then
- 8: ⊳ Single regeneration
- 9: end if
- 10: if then
- 11: return
- 12: end if
- 13: ⊳ Phase 4: Network preparation
- 14: ⊳ Baseline
- 15: for each do
- 16: ⊳ Intervention
- 17: end for
- 18: ⊳ Phase 5
- 19: return
3.2 GTFS diagnostic analysis
The diagnostic module transforms the GTFS feed into a structured representation comprising service frequency (D1), temporal distribution (D2), spatial coverage and network redundancy (D3), stop spacing (D4), route efficiency (D5), fare concession structure (D6), and service intensity (D7). These dimensions operationalise established transit performance evaluation concepts using scheduled trips, stop locations, route geometries, and fare attributes (Ceder, 2016; Ibarra-Rojas et al., 2015; Transportation Research Board, 2013). The indicators characterise planned service provision rather than observed passenger demand or realised operating performance.
3.2.1 D1: service frequency
Service frequency is measured using scheduled headway, defined as the interval between consecutive departures in the same direction (Transportation Research Board, 2013; Walker, 2024). For route and direction , the mean scheduled headway is calculated using Equation 1.
where denotes the scheduled departure count and is the elapsed time between the first and last departures, expressed in minutes. The route-level indicator is for services operating in both directions. Following the frequency-based planning concepts discussed by Walker (2024), three study-defined categories are adopted: Good ( min), Moderate ( min), and Poor ( min).
To distinguish daily frequency from time-specific service provision, headway can also be calculated for a defined operating period P. The period-specific scheduled headway is calculated using Equation 2.
where represents departures within P, and the numerator is the elapsed time between its first and last departures. This formulation supports peak and off-peak comparisons when the corresponding periods are specified. The hourly service distribution is examined separately in D2 and D7.
3.2.2 D2: temporal distribution
Temporal distribution describes the allocation of scheduled departures across the operating day. The hourly trip matrix contains departure counts for route r during hour h. The coefficient of variation is calculated using Equation 3.
where and denote the mean and standard deviation of hourly departure counts across the defined operating hours of route r. The network-level mean coefficient of variation is calculated using Equation 4.
Values approaching zero indicate relatively uniform hourly service, whereas larger values reflect greater temporal variation. This measure characterises scheduled supply and differs from operational headway variability, which concerns irregularities in actual departure or arrival intervals (Tirachini et al., 2022). Temporal uniformity alone does not establish inefficient scheduling or a mismatch with passenger demand.
3.2.3 D3: Spatial coverage and network redundancy
Spatial service characteristics are examined using GTFS stop coordinates and route-stop relationships, consistent with established transit accessibility and connectivity approaches (El-Geneidy et al., 2014; Welch and Mishra, 2013; Currie, 2010). For each stop , the redundancy index represents the number of distinct routes serving that stop. The single-route vulnerability ratio is defined in Equation 5.
Higher SRR values indicate greater dependence on individual routes at the stop level and potential exposure to route disruptions. The spatial distribution of additionally identifies interchange concentrations and areas with limited route overlap. These indicators describe structural redundancy rather than population-weighted accessibility, route substitutability, or disruption probability.
3.2.4 D4: stop spacing
Stop spacing is assessed through the geographic distance between consecutive scheduled stops. The Haversine distance between consecutive stops is calculated using Equation 6.
where m is the approximate Earth’s mean radius, and are stop latitudes, and and are coordinate differences in radians.
A study-defined threshold of m is used to screen closely spaced consecutive stops, informed by conventional stop-spacing considerations (Transportation Research Board, 2013). The number of flagged stop pairs is denoted by . This threshold is not a universal minimum: short spacing may be appropriate under particular pedestrian accessibility and urban operating conditions. Similarly, unusually short distances may indicate stop-location inconsistencies requiring verification rather than confirmed GTFS errors.
3.2.5 D5: route efficiency
Route efficiency is explored through the relationship between scheduled speed and route characteristics. For route r, scheduled speed is calculated as , where is the representative route length in kilometres and is the corresponding scheduled journey duration in hours. Both quantities refer to the same route traversal. The exploratory regression model is specified in Equation 7.
where denotes scheduled stop count, and are regression coefficients, and represents the residual term. The formulation draws upon established transit operating and scheduling concepts (Ceder, 2016; Ibarra-Rojas et al., 2015; Guihaire and Hao, 2008).
A positive indicates an association between greater stop count and higher scheduled speed conditional on route length. It does not independently establish scheduling inefficiency because road hierarchy, congestion, signals, stop spacing, and operating conditions may also influence scheduled travel times. The regression is therefore interpreted as an exploratory diagnostic rather than a causal assessment of route efficiency.
3.2.6 D6: fare concession structure
The fare diagnostic examines relative fare levels across passenger categories. Although fare concessions contribute to affordability, comprehensive equity assessment additionally requires socioeconomic and travel-demand information (Welch and Mishra, 2013; Currie, 2010). The maximum-fare ratio is defined in Equation 8.
where represents the published fare for passenger category c and origin-destination combination ( o , d ). The ratio is evaluated where comparable category-specific fare information is available and the denominator is positive.
For example, indicates that the maximum child fare is 50% lower than the maximum adult fare. However, this aggregate ratio does not establish identical concessions across all journeys. The indicator is therefore interpreted as a descriptive measure of fare concession structure rather than comprehensive fare equity.
3.2.7 D7: service intensity
Service intensity preserves the route-level and hourly distribution of scheduled departures represented by the matrix . Network-wide hourly service intensity is calculated using Equation 9.
The route-hour matrix is visualised as a heatmap to identify differences in service provision across routes and operating periods. Whereas D2 summarises temporal dispersion through the coefficient of variation, D7 retains the underlying spatially disaggregated service pattern. Together, these dimensions distinguish aggregate temporal variability from route-specific scheduled service intensity without treating either indicator as observed passenger demand.
3.3 LLM diagnostic reasoning
The diagnostic reasoning module converts the seven-dimensional GTFS representation into a prioritised set of potential service deficiencies. The diagnostic indicators are serialised and supplied to the LLM with instructions defining the analytical task, required evidence, and JSON output schema. For each identified issue , the model is instructed to report the affected diagnostic dimension, relevant routes or stops, supporting quantitative indicators, a concise interpretation, and three intervention priority criteria: passenger impact, fixability, and data confidence. The prompt distinguishes directly observed schedule characteristics from potential operational consequences that require further evidence.
Passenger impact represents the potential passenger-facing consequences of an issue, assessed from scheduled frequency, service availability, and route or stop exposure rather than observed ridership. Fixability reflects the relative practicality of formulating an intervention using the available service attributes, with lower assessments assigned to changes requiring substantial external information or resources. Data confidence indicates how directly and consistently the GTFS diagnostics support the identified issue. Each criterion is expressed on a common scale from 0 to 100, with higher values indicating greater potential impact, greater fixability, or stronger supporting evidence.
The intervention priority index is calculated as:
The weights assign greater emphasis to potential passenger-facing consequences than to intervention practicality or evidential confidence. They are study-defined heuristic parameters, not coefficients estimated from passenger preferences or operational data. Thus, is interpreted as a relative intervention priority index, not a validated measure of deficiency severity or passenger welfare. Issues are sorted in descending order to guide subsequent scenario generation.
The LLM is queried at a temperature of to limit sampling variability. As this setting does not guarantee identical outputs, response consistency is assessed separately in Section 3.7. The generated response undergoes JSON parsing and schema validation, with one corrective regeneration attempt permitted if the initial response is invalid. Algorithm 2 summarises the procedure.
LLM Diagnostic Reasoning and Issue Prioritisation.
- Require: LLM , diagnostic structure , temperature
- Ensure: Priority-sorted issue list or diagnostic failure
- 1:
- 2:
- 3:
- 4:
- 5: if not then
- 6:
- 7:
- 8:
- 9: end if
- 10: if not then
- 11: return
- 12: end if
- 13: for each do
- 14: Extract passenger impact, fixability, and data confidence
- 15: Calculate using Equation 10
- 16: end for
- 17: Sort by descending
- 18: return
3.4 LLM scenario generation and validation
The scenario generation module translates the prioritised issue list into machine-readable transit service interventions. The LLM receives the diagnostic findings, valid GTFS route identifiers, and a structured output schema specifying the affected routes, proposed modifications, operating windows, and supporting justifications. Candidate scenarios primarily modify scheduled service frequency and departure times while preserving service attributes not targeted by the intervention.
Let denote the jth intervention scenario and its proposed headway for route r, direction d, and operating period P. For a scheduling window of duration , the revised scheduled departure count is calculated using Equation 11.
where the initial departure is included and the floor operator prevents generated departures from exceeding the specified window. The corresponding departure times are calculated using Equation 12.
where is the first departure in the applicable window and q indexes its generated trips. The formulation permits direction-specific and time-dependent headways when these are specified in the scenario. For adjacent scheduling windows, departure generation must avoid duplicating trips at shared boundaries.
The intervention is applied to the baseline feed to obtain . Each generated trip must retain a valid route, stop sequence, and associated timetable information, with schedule fields updated consistently for its assigned departure time. Unmodified service components remain unchanged. The resulting scenario-specific feed provides the scheduled transit configuration for SUMO evaluation.
Each candidate is assessed against five predefined technical criteria:
- C1: Non-empty intervention. At least one explicit modification to the baseline service must be specified.
- C2: Valid route identification. All referenced routes must exist in the analysed GTFS feed.
- C3: Headway admissibility. Proposed headways must satisfy min. These are study-defined screening bounds, not evidence of fleet or financial feasibility.
- C4: Diagnostic justification. Each intervention must contain a non-empty justification meeting the prescribed length requirement and linking the modification to an identified service issue.
- C5: Structured specification. The output must satisfy the required schema and contain valid parameter types and the fields needed to construct the modified schedule.
Let indicate whether scenario satisfies criterion l. The technical validity score is calculated using Equation 13.
A scenario is accepted only if ; failure on any criterion results in rejection. The score therefore summarises five mandatory checks rather than allowing one criterion to compensate for another. Accepted scenarios are collected in , with duplicate specifications excluded from the requested scenario count.
If fewer than k valid scenarios are returned, the master pipeline permits one further generation attempt using validation feedback. Simulation proceeds only when the required number of valid scenarios is available, as specified in Algorithm 1. Algorithm 3 describes one candidate-generation and validation pass.
Technical validity establishes whether a proposal satisfies the predefined requirements for constructing a simulation input. It does not establish real-world feasibility concerning passenger demand, fleet availability, driver schedules, operating expenditure, or institutional constraints. Successful SUMO execution and the operational consequences of each accepted intervention are assessed separately in the subsequent phase.
LLM Scenario Generation and Technical Validation.
- Require: LLM , prioritised issues , target count k, valid routes
- Ensure: Validated scenario set , where
- 1:
- 2:
- 3:
- 4:
- 5: for each candidate do
- 6: Evaluate
- 7:
- 8: if and then
- 9:
- 10: end if
- 11: if then
- 12: break
- 13: end if
- 14: end for
- 15: return
3.5 SUMO microsimulation and KPI extraction
The microsimulation module evaluates baseline and intervention service configurations within a common road network using Simulation of Urban Mobility (SUMO), an open-source platform for modelling individual vehicle movements and transportation operations (Lopez et al., 2018; Krajzewicz et al., 2012). The procedure comprises road network preparation, GTFS-to-network mapping, scenario simulation, and extraction of comparable operational indicators.
The road network is extracted from OpenStreetMap (OSM) within the study-area bounding box B using OSMnx (Boeing, 2017). Drivable connections are retained, disconnected network elements are filtered, and the resulting network is converted into SUMO-compatible format using netconvert. The same processed network is used for the baseline and all intervention scenarios, maintaining a consistent spatial representation across simulation runs.
GTFS stops are mapped to eligible SUMO road edges using nearest-edge projection. Consecutive mapped stops are then connected in their GTFS-defined order using Dijkstra’s shortest-path algorithm with free-flow travel-time edge weights. This procedure preserves the scheduled stop sequence but approximates the intervening road alignment. Reconstructed paths may therefore differ from the original GTFS shapes or observed bus trajectories, particularly where road restrictions, missing links, or alternative street connections affect the shortest path. Stop-matching coverage and route connectivity are used to assess the structural completeness of the converted network.
The network preparation checks establish whether scheduled services can be represented computationally; they do not constitute independent traffic-model calibration. In the absence of observed traffic counts, bus trajectories, or realised journey times, the reconstructed network is treated as a consistent simulation environment rather than a validated reproduction of prevailing operating conditions.
The baseline simulation uses the original GTFS service configuration, whereas intervention j uses the modified feed . All runs retain the same network, KPI definitions, and modelling assumptions, with scheduled service modifications constituting the principal differences between configurations. Comparisons therefore describe simulated responses under the adopted assumptions rather than independently verified effects of real-world implementation.
The evaluation is primarily vehicle- and schedule-oriented. Static GTFS does not provide observed passenger arrivals, origin-destination demand, boarding volumes, or occupancy. Accordingly, the simulation does not independently establish passenger waiting time, crowding, ridership changes, or demand-responsive effects. Technical execution of additional scheduled trips also does not demonstrate the availability of the vehicles and drivers required for implementation.
Let denote the set of transit-vehicle trips completed within the simulation horizon. For completed trip i, let denote its simulated distance in kilometres, its duration in seconds, and the trip-level waiting-time quantity extracted from the simulation output, also in seconds. Four simulation performance indicators are calculated: completed vehicle trips using Equation 14, distance-weighted mean vehicle speed using Equation 15, the mean vehicle waiting-time indicator using Equation 16, and total completed-trip vehicle distance using Equation 17.
Here, measures completed simulated transit-vehicle trips, is the distance-weighted mean vehicle speed, is the arithmetic mean of the extracted trip-level waiting-time indicator, and is total completed-trip vehicle distance. The speed formulation uses seconds for , hence the conversion factor of 3,600. The mean waiting-time indicator is not interpreted as passenger waiting time unless its extraction procedure explicitly models passenger arrivals and boarding.
For each KPI component a, the percentage change under scenario is calculated relative to the baseline:
where and are the baseline and intervention values, respectively. A positive change indicates an increase and a negative change indicates a reduction; their desirability depends on the KPI. For example, additional completed trips indicate greater simulated service output, whereas additional vehicle kilometres indicate greater vehicle activity and potential resource requirements. Average speed and waiting-time comparisons are interpreted alongside trip completion because changes in the set of completed trips may also affect aggregate KPI values.
Finally, technical scenario validity, successful simulation execution, and implementation feasibility are treated as distinct conditions. Completed trips and vehicle kilometres provide operational indicators but do not determine fleet requirements, driver duties, operating costs, or economic viability. The resulting assessment therefore compares alternative scheduled service configurations under common modelling assumptions rather than establishing their complete real-world feasibility.
3.6 LLM results interpretation and recommendation
The final module translates the baseline and intervention KPI vectors into a structured comparison of service alternatives. The LLM receives , each scenario-specific vector , and the corresponding percentage changes calculated using Equation 18. These inputs enable the model to interpret simulated performance differences alongside the original diagnostic findings and proposed service modifications.
Five planning dimensions are considered: service frequency, simulated transit-vehicle speed, the trip-level waiting-time indicator, fleet-related resource implications, and service coverage. Frequency is assessed from the revised schedules; speed and waiting-time performance are derived from the simulation outputs; and resource implications are considered through completed trips and vehicle kilometres. These activity measures do not establish actual fleet utilisation, vehicle requirements, or operating costs. Coverage is interpreted according to the intervention scope: additional departures may improve temporal service availability, but they do not expand physical network coverage when routes and stops remain unchanged.
For each scenario , the LLM produces a planning assessment vector , where represents an ordinal assessment of dimension l. Higher scores indicate a more favourable assessment under the specified planning criteria. The scores summarise the supplied analytical evidence; they are not independently estimated passenger preferences, monetary benefits, or welfare effects.
The scenario ranking is obtained through the weighted aggregation defined in Equation 19.
where represents the relative importance assigned to planning dimension l. The default specification uses uniform weights, . Alternative weights allow the assessment to reflect different planning priorities, such as greater emphasis on service availability or resource requirements. The resulting ordering is conditional on the ordinal assessments and selected weights rather than an objectively established optimum.
The LLM then generates a planning brief summarising the diagnosed issues, proposed interventions, principal KPI changes, and operational trade-offs. The brief distinguishes simulated outcomes from unverified passenger benefits and implementation requirements. Accordingly, the final output supports evidence-informed comparison of service alternatives but does not replace passenger-demand validation, resource assessment, or agency-specific planning judgement.
3.7 LLM benchmarking and ablation
The benchmarking procedure addresses RO3 by comparing four openly available LLMs for structured transit diagnostic reasoning: Llama 3.3 70B, Llama 3.1 8B, Llama 4 Scout 17B, and Qwen3 32B. All models are accessed through the Groq cloud inference API under the service arrangement available during the study. The same GTFS-derived diagnostic inputs, task instructions, and required output structure provide a common basis for assessing response quality and computational requirements.
Diagnostic quality is evaluated using five criteria: issue identification, reasoning depth, actionability, schema compliance, and quantitative grounding. Issue identification assesses recognition of service characteristics supported by the supplied data; reasoning depth evaluates the coherence of their interpretation; actionability considers the specificity of proposed planning responses; schema compliance assesses adherence to the required machine-readable structure; and quantitative grounding evaluates the use of relevant diagnostic indicators to support analytical claims. The diagnostic quality score is calculated using Equation 20.
where is the score assigned to model m under criterion c. The aggregate score represents performance against the study-defined rubric, not independently verified diagnostic accuracy or general model capability. In particular, quantitative grounding evaluates whether a response appropriately uses the supplied indicators; it does not validate the GTFS source data or establish the real-world consequences of an identified issue.
Output consistency is examined through five repetitions of an identical diagnostic task using the selected model and inference configuration. For diagnostic issue z, the repeated-run topic detection rate is calculated using Equation 21.
where denotes the issues identified in repetition i and is the indicator function. A detection rate of 1.0 indicates that the issue appeared in all five responses. The assessment distinguishes recurrence of the principal findings from variation in secondary issues or their explanations; repeated identification does not independently confirm diagnostic correctness.
Response latency and token consumption are also recorded. Their relative variation across repeated runs is summarised using the coefficient of variation, , where and denote the mean and standard deviation of the recorded quantity. These indicators characterise computational efficiency and variability under the evaluated API configuration. They do not establish identical performance under alternative hardware, inference providers, or service conditions.
An ablation-oriented baseline comparison examines the contribution of diagnostic context and LLM-assisted reasoning to scenario formulation. Four configurations are evaluated: a random baseline, a rule-based baseline, and two LLM-generated interventions, denoted LLM-S1 and LLM-S2. The random baseline assigns admissible headway modifications without using the diagnostic priorities to select an intervention. The rule-based baseline halves the scheduled headway of routes classified as poorly served under the study-defined threshold min. LLM-S1 and LLM-S2 instead use the prioritised diagnostic findings to formulate context-specific service modifications.
All configurations are assessed against five scenario-quality criteria: issue identification, contextual relevance, actionability, SUMO compatibility, and trade-off reasoning. These criteria distinguish an intervention’s relationship to the diagnostic evidence, its specificity, its suitability for the simulation workflow, and its consideration of competing operational objectives. For configuration a, the aggregate scenario-quality score is calculated using Equation 22.
where represents the assessment under criterion c. Technical validation under Section 3.4 and rubric-based scenario quality are distinct: a structurally admissible headway modification may still have limited contextual relevance or trade-off reasoning.
The comparison evaluates the quality of the four generated intervention specifications under the study’s rubric. It does not, by itself, isolate the causal contribution of every framework component or establish superior passenger outcomes. The operational consequences of the intervention scenarios are evaluated separately through the SUMO analysis in Section 3.5. Algorithm 4 summarises the scenario-quality comparison.
Scenario Generation Baseline and Ablation Comparison.
- Require: Diagnostic structure , GTFS feed , configuration set
- Ensure: Criterion-level scores and aggregate scores
- 1:
- 2: for each configuration do
- 3:
- 4: Assess against the five scenario-quality criteria
- 5: for c = 1 to 5 do
- 6:
- 7: Record in
- 8: end for
- 9:
- 10: end for
- 11: return
4 Results
4.1 Case study: MyBas Johor Bahru
TransitSim-LLM was evaluated using the MyBas public bus network in Johor Bahru, Malaysia, a major urban and cross-border transportation centre adjacent to Singapore. The case study examines the integration of GTFS-based diagnostics, LLM-assisted intervention generation, and SUMO microsimulation in a Southeast Asian transit context.
The GTFS feed was obtained from Malaysia’s national open data portal (data.gov.my) in January 2025. GTFS-based spatial and network analysis has previously been applied to transit efficiency and accessibility assessment in Malaysian urban contexts (Hassan et al., 2025b). The analysed feed contains 21 routes, 1,856 scheduled weekday trips, and 271 unique stops, together with 84,302 stop-time records, 18,440 route-shape points, 12 fare attribute definitions, and 63 fare-route mappings. Its composition is summarised in Table 1.
TABLE 1 Composition of the analysed MyBas Johor Bahru GTFS feed.
| File | Contents | Records |
|---|---|---|
| agency.txt | Operator details | 1 |
| routes.txt | Bus routes | 21 |
| stops.txt | Unique stops | 271 |
| trips.txt | Scheduled trips | 1,856 |
| stop_times.txt | Stop arrival/departure times | 84,302 |
| calendar.txt | Service calendar | 3 |
| shapes.txt | Route geometry points | 18,440 |
| fare_attributes.txt | Fare definitions | 12 |
| fare_rules.txt | Fare-route mappings | 63 |
The simulation network was constructed from OpenStreetMap using OSMnx (version 1.9), within approximately 103.4– E and 1.35– N. Following network filtering, the processed representation contained approximately 28,400 nodes and 72,600 directed edges. Of the 271 GTFS stops, 263 were matched to eligible road edges, corresponding to 97.0% mapping coverage. The eight unmatched stops constitute a limitation of the converted network representation. These statistics describe structural preparation of the simulation inputs, not independent calibration against observed traffic or bus operations.
4.2 GTFS diagnostic results
Scheduled headways vary substantially across the 21 routes (Figure 2). Route J32 has the shortest reported mean headway of 6 min and 216 daily trips, whereas J200 has the longest headway of 60 min and 17 daily trips. Route J42 also has a comparatively long headway of 44 min.
FIGURE 2 Mean scheduled headways across the MyBas routes, classified using the study-defined frequency thresholds. J200 and J42 have the longest reported headways of 60 and 44 min, respectively.
Under the study-defined thresholds, nine routes (43%) are classified as Good, ten (48%) as Moderate, and two (9%) as Poor. The median route headway is approximately 16 min. J200 and J42 therefore emerge as the principal frequency-related intervention candidates because their schedules provide comparatively infrequent departure opportunities. These findings characterise planned service availability rather than observed passenger waiting time or demand.
The reported network-level coefficient of variation is , indicating limited dispersion in scheduled hourly departure counts under the adopted calculation procedure.
Of the 271 unique stops, 208 are served by only one distinct route. The resulting single-route vulnerability ratio for the MyBas network is calculated using Equation 23.
Thus, 76.8% of stops have no alternative route recorded at the same stop, while the remaining 63 are served by at least two routes. Figure 3 shows that route overlap is concentrated around major interchanges, particularly JB Sentral and Larkin Sentral, where at least ten distinct routes serve each location.
FIGURE 3 Stop-level route redundancy across the MyBas network. Of 271 stops, 208 are served by one route, yielding . JB Sentral and Larkin Sentral exhibit the highest reported route overlap.
The result indicates structural dependence on individual routes at many stops. It does not establish that affected passengers lack nearby alternatives or that all overlapping routes offer substitutable destinations and service levels. Assessment of practical redundancy would additionally require walking access, route connectivity, and passenger travel patterns.
The geographic screening identifies 39 consecutive stop pairs below the study-defined 400 m threshold (Figure 4). The shortest recorded separation is approximately 32 m on Route J34. Route-level distributions also show variation in median spacing and dispersion across the network.
FIGURE 4 Geographic separation between consecutive scheduled stops by route. The dashed line marks the study-defined 400 m screening threshold; 39 stop pairs fall below this value.
These findings identify locations for further examination, not confirmed cases of inappropriate stop placement. Short distances may reflect legitimate boarding arrangements or dense urban activity; unusually close coordinates may also warrant a check for duplicate or incorrectly located GTFS stops. Physical verification and pedestrian accessibility assessment are required before recommending consolidation.
The exploratory regression identifies a positive association between scheduled operating speed and stop count after accounting for route length. The estimated coefficient is km/h per stop ( p < 0.05 ), as illustrated in Figure 5.
FIGURE 5 Relationship between scheduled route speed and stop count, with bubble size representing route length. The positive conditional stop-count coefficient ( km/h per stop) is an exploratory association rather than evidence of causation or confirmed scheduling inefficiency.
The result indicates that routes with more stops tend to have higher scheduled speeds conditional on the included route length. It does not demonstrate that additional stops improve vehicle performance or that the timetables are inefficient. Road hierarchy, stop spacing, signal control, congestion, and scheduled dwell allowances may influence the relationship. The regression therefore identifies a pattern for further investigation rather than a causal effect or confirmed scheduling deficiency.
The published adult fares range from MYR 0.90 to MYR 6.20. The reported adult-to-child and adult-to-senior maximum-fare ratios are both , indicating that the maximum fare recorded for each concessionary category is half the adult maximum (Figure 6).
FIGURE 6 Published fare structure by passenger category. (a) Fare distribution by rider category. (b) Fare summary by category.
The ratios describe differences between category-specific maximum fares; they do not establish a uniform 50% discount for every origin–destination pair. The diagnostic therefore characterises the published concession structure rather than overall affordability or distributional fare equity.
Figure 7 presents scheduled departures by route and hour. Higher-frequency routes exhibit denser service patterns, whereas lower-frequency routes record fewer departures across their operating periods. Pronounced hourly intensification is limited across much of the network.
FIGURE 7 Route-hour heatmap of scheduled departures across the 21 MyBas routes.
The heatmap complements D2 by identifying the routes and hours contributing to the aggregate temporal pattern. It represents scheduled service intensity, not observed ridership, vehicle occupancy, or realised reliability.
4.3 LLM diagnostic and scenario generation results
The LLM diagnostic module identifies four principal planning concerns: low scheduled frequency on selected routes, limited temporal variation, high stop-level dependence on individual routes, and closely spaced consecutive stops. Frequency deficiencies on J200 and J42 receive the highest priority, supported by their 60 and 44 min scheduled headways. Temporal distribution and single-route dependence receive intermediate assessments, while stop spacing receives a lower relative priority because appropriate changes require additional local verification.
The ordering follows the study-defined priority function in Equation 10. Its component scores represent LLM-assessed potential passenger impact, fixability, and data confidence, rather than independently measured passenger effects. The identified issues are traceable to the corresponding GTFS indicators, establishing consistency between the input diagnostics and generated interpretations. This traceability does not constitute independent expert or passenger-demand validation of the issues as operational deficiencies.
Two interventions were subsequently formulated for simulation. Scenario 1 (S1) emphasises frequency enhancement for selected low-frequency services, while Scenario 2 (S2) applies a more temporally focused service adjustment. Both are evaluated against the original GTFS configuration in Section 4.4.
4.4 Simulation results
4.4.1 Scenario comparison
The baseline and two intervention configurations were evaluated using the common SUMO network. Table 2 reports completed transit-vehicle trips, distance-weighted mean speed, the trip-level waiting-time indicator, and total completed-trip vehicle distance. Figure 8 presents the corresponding relative performance changes.
TABLE 2 Simulation KPIs under baseline and intervention configurations.
| Metric | Baseline | S1 | (%) | S2 | (%) |
|---|---|---|---|---|---|
| Completed trips | 1,856 | 1,952 | +5.3 | 1,888 | +1.7 |
| Mean speed (km/h) | 22.4 | 21.8 | - 2.9 | 22.3 | - 0.6 |
| Waiting-time indicator (s) | 184.0 | 172.6 | - 6.2 | 180.5 | - 1.9 |
| Vehicle distance (km) | 18,240 | 19,300 | +5.8 | 18,605 | +2.0 |
Absolute values are rounded; percentage changes are computed from the underlying simulation outputs.
FIGURE 8 Relative simulation performance under S1 and S2 compared with the baseline, normalised to 100%. The figure additionally displays a supplementary vehicle time-loss indicator.
The baseline records 1,856 completed trips, a mean speed of 22.4 km/h, a waiting-time indicator of 184.0 s, and 18,240 vehicle-km. Under S1, completed trips increase to 1,952 (+5.3%), the waiting-time indicator decreases to 172.6 s (- 6.2%), and vehicle distance increases to 19,300 km (+5.8%). Mean speed decreases to 21.8 km/h (- 2.9%).
S2 produces smaller changes: 1,888 completed trips (+1.7%), a waiting-time indicator of 180.5 s (- 1.9%), and 18,605 vehicle-km (+2.0%). Mean speed decreases slightly to 22.3 km/h (- 0.6%). Both scenarios increase completed simulated service activity, but S1 produces larger changes in trip completion, the reported waiting-time indicator, and total vehicle distance.
4.4.2 Operational trade-offs
Figure 9 presents a comparative assessment of the relative changes in five simulation performance indicators under Scenarios S1 and S2. The figure illustrates the magnitude of changes in completed trips, mean speed, waiting-time indicator, vehicle time loss, and total vehicle distance relative to the baseline configuration. S1 exhibits greater changes in service output and the reported waiting-time indicator, accompanied by increased vehicle distance and reduced mean speed. In contrast, S2 shows more moderate changes across these indicators. The comparison highlights the operational trade-offs between service enhancement and additional vehicle activity. Importantly, the indicators represent distinct aspects of simulated transit performance and should not be interpreted as additive measures of overall benefit.
FIGURE 9 Relative KPI changes under S1 and S2 compared with the baseline. Positive waiting-time values indicate reductions, while other indicators reflect their respective changes.
The additional 1,060 vehicle-km under S1 and 365 vehicle-km under S2 indicate greater simulated vehicle activity relative to the baseline. These differences may have implications for vehicle-hours, energy use, maintenance, staffing, and expenditure, but none of these requirements can be quantified from distance alone. Similarly, lower aggregate speed does not establish which specific road or service interactions caused the change.
The supplementary time-loss measure shown in Figs. Figures 8, 9 is a vehicle-oriented simulation indicator and is distinct from passenger waiting time. Overall, the scenarios illustrate competing changes in service output and operating activity, supporting multi-indicator assessment rather than interpretation through a single KPI.
4.4.3 Multi-criteria trade-off assessment
Figure 10 presents the LLM-generated assessments across service frequency, simulated transit-vehicle speed, waiting-time performance, fleet-related resource implications, and coverage. Under uniform weights, S1 receives an aggregate score of 4.0 and the higher assessment under the study-defined recommendation function. When the weight assigned to fleet-related considerations is increased to , the reported ordering changes in favour of S2.
FIGURE 10 Study-defined multi-criteria assessments of S1 and S2 across five planning dimensions. The reported scenario ordering changes when fleet-related considerations receive greater weight ; the scores do not represent observed passenger preferences or monetised benefits.
This sensitivity reflects the different operational profiles of the scenarios. S1 provides more completed service and a larger reduction in the waiting-time indicator, whereas S2 requires a smaller increase in vehicle distance. The ordering depends on the ordinal scores and planning weights; it is not evidence that either intervention is universally preferable or operationally feasible.
The fleet-related dimension represents inferred resource implications, not measured fleet utilisation. Likewise, frequency changes may improve temporal service availability without extending physical route or stop coverage. The multi-criteria assessment therefore provides a conditional comparison of service alternatives rather than an independently validated optimisation result.
4.5 LLM benchmarking results
4.5.1 Model comparison
Four openly available LLMs were evaluated using the common structured transit diagnostic task: Llama 3.3 70B, Llama 3.1 8B, Llama 4 Scout 17B, and Qwen3 32B.
Llama 3.3 70B, Llama 3.1 8B, and Llama 4 Scout 17B each receive Q = 85 / 100, while Qwen3 32B receives Q = 65 / 100. The three identical aggregate scores indicate comparable performance under this particular assessment rubric, not equivalence across other tasks or independent confirmation of diagnostic correctness. The models also differ in inference requirements. Among those receiving Q = 85 / 100, Llama 4 Scout 17B has the lowest reported response latency, approximately 0.4 s.
4.5.2 Diagnostic consistency
The repeated-run assessment evaluates Llama 3.3 70B across five identical diagnostic requests (Figure 11). The low-frequency issue is identified in all five runs, producing a topic detection rate of 1.0. Peak-period service distribution and network redundancy appear in approximately two or three runs each, indicating greater variation in secondary issue selection.
FIGURE 11 Five-run consistency assessment for Llama 3.3 70B, showing topic detection, response latency, and token consumption. The frequency issue appears in all five runs, and token consumption has a reported coefficient of variation of 0.020. (a) Topic consistency. (b) Response latency. (c) Token usage (CV = 0.020).
Mean response latency is approximately 0.5 s, while token consumption has a reported coefficient of variation of 0.020. The low token variation indicates relatively stable output volume, but not necessarily identical analytical content. These findings characterise consistency under the tested configuration; repeated topic detection does not constitute ground-truth validation.
4.5.3 Token usage and ablation
The recorded analytical workflow consumes 22,283 tokens, of which diagnostic reasoning and scenario generation account for 62.4% (Figure 12). These phases represent the principal recorded LLM-related computational workload. The distribution provides a basis for examining prompt efficiency but does not establish a fixed daily throughput or guaranteed free-tier operating capacity.
FIGURE 12 Recorded token consumption by TransitSim-LLM analytical phase. Total usage is 22,283 tokens, with diagnostic reasoning and scenario generation accounting for 62.4%. (a) Token usage by pipeline phase. (b) Total: 22,283 tokens.
The scenario-generation comparison evaluates random, rule-based, and two LLM-generated configurations using the five criteria defined in Section 3.7. The LLM-generated configurations receive aggregate scores of 80 for S1 and 86 for S2, compared with 43 for the rule-based baseline and 25 for the random baseline (Figure 13).
FIGURE 13 Scenario-quality comparison of random, rule-based, and LLM-generated configurations under the study-defined rubric. Aggregate scores are 25, 43, 80, and 86, respectively.
Relative to the rule-based configuration, S1 and S2 differ by 37 and 43 points, respectively. The corresponding differences from the random configuration are 55 and 61 points. The reported comparison particularly distinguishes the LLM-generated interventions in trade-off reasoning, reflecting their use of diagnostic context and structured justifications rather than headway modification alone.
These differences concern scenario formulation under the study-defined rubric. They do not independently establish superior passenger outcomes, economic feasibility, or the isolated contribution of every framework component. The SUMO comparisons provide separate evidence about the simulated operational consequences of the two interventions.
5 Discussion
5.1 Integrated framework performance and methodological implications
The results demonstrate the application of an integrated GTFS–LLM–SUMO workflow for diagnosing scheduled transit services, generating interventions, and comparing their simulated operational consequences. By linking seven GTFS-derived dimensions with structured LLM reasoning and microsimulation, TransitSim-LLM extends existing language-based transit information retrieval toward intervention-oriented analytical support. The diagnostic stage identified four principal concerns: low frequency on selected routes, limited temporal variation, single-route dependence at numerous stops, and closely spaced stops. Their interpretation illustrates the value of combining temporal, spatial, and operational indicators while distinguishing schedule-derived characteristics from deficiencies that require independent passenger or field evidence.
The generated interventions satisfied the reported technical validation requirements and produced different operational outcomes under common simulation assumptions. S1 increased completed vehicle trips by 5.3% and reduced the reported waiting-time indicator by 6.2%, alongside a 5.8% increase in vehicle kilometres and a 2.9% reduction in mean speed. S2 produced smaller changes across these indicators. The comparison demonstrates why service enhancements should be assessed through multiple KPIs: greater simulated service output can coincide with additional vehicle activity and changes in operating speed. However, technical scenario validity does not establish implementation feasibility, and the waiting-time result must retain the precise meaning of the quantity extracted from the simulation.
The benchmarking results further characterise the framework’s LLM-related requirements. Three Llama models achieved Q = 85 / 100 under the study-defined diagnostic rubric, while Qwen3 32B achieved Q = 65 / 100. The five-run assessment consistently identified the principal frequency-related issue, although secondary topics varied. The LLM-generated interventions also received higher scenario-quality assessments than the rule-based and random configurations. These findings support the use of comparative evaluation when selecting models for structured transit analysis, but rubric scores and repeated topic detection do not constitute independent ground-truth validation.
5.2 Planning and policy implications
The Johor Bahru application highlights several planning priorities, including targeted frequency enhancement, demand-responsive service allocation, network connectivity, and stop-spacing review. As summarised in Table 3, these priorities arise from GTFS-derived service diagnostics but require further assessment of passenger demand, operational feasibility, and local conditions before implementation. The frequency-enhancement scenario also increased vehicle kilometres by 5.8%, underscoring the need to consider additional operating resources alongside potential service improvements.
TABLE 3 Planning implications and implementation requirements derived from the TransitSim-LLM assessment.
| Dimension | Diagnostic evidence | Planning application | Further assessment |
|---|---|---|---|
| Service frequency (D1) | J200: 60 min; J42: 44 min mean headway | Examine targeted frequency enhancements | Passenger demand, fleet availability, and operating resources |
| Temporal distribution (D2/D7) | Low reported hourly variability | Evaluate time-specific service allocation | Observed hourly ridership and vehicle scheduling |
| Network redundancy (D3) | 208 single-route stops | Assess alternative connections and route overlap | Walking access, route substitutability, and spatial demand |
| Stop spacing (D4) | 39 consecutive stop pairs below 400 m | Review stop locations and potential data inconsistencies | Physical locations, pedestrian access, and local conditions |
| Operational resources | S1 increases vehicle kilometres by 5.8% | Include added vehicle activity in scenario appraisal | Fleet size, vehicle-hours, driver duties, and expenditure |
TransitSim-LLM offers a planning-support framework that integrates open service data, LLM-assisted analysis, and simulation-based scenario evaluation. Its practical adoption remains contingent on data quality, technical capacity, and computational resources. The framework should therefore complement, rather than replace, passenger-demand analysis, economic appraisal, and agency-specific operational judgement.
6 Conclusion
This study introduced TransitSim-LLM, an integrated framework linking GTFS-based diagnostics, LLM-assisted reasoning, and SUMO microsimulation to support transit service evaluation and intervention planning. The framework provides a structured and traceable approach to identifying potential service deficiencies, generating technically valid interventions, and evaluating alternative service configurations. Its principal contribution lies in connecting data-driven diagnostics with simulation-informed planning while making operational trade-offs explicit.
The application to the MyBas network in Johor Bahru demonstrated the framework’s ability to identify service-related concerns and formulate corresponding intervention scenarios. The comparative simulation results showed that the frequency-enhancement scenario increased completed vehicle trips by 5.3% and reduced the reported waiting-time indicator by 6.2%, accompanied by a 5.8% increase in vehicle kilometres. Furthermore, the LLM benchmarking results demonstrated the potential of openly available language models for structured transit diagnostic tasks, with three Llama models achieving diagnostic quality scores of 85/100 under the study-defined rubric. The LLM-generated scenarios also achieved higher rubric-based quality scores than the rule-based and random alternatives.
Overall, the findings demonstrate the potential of combining open transit data, LLM-assisted analytical reasoning, and microsimulation within a unified planning-support framework. TransitSim-LLM provides a systematic approach for examining alternative transit service configurations and communicating their operational trade-offs, particularly in resource-constrained transit planning contexts.
6.1 Limitations and future research directions
Despite its methodological contributions, this study has several limitations that should be considered when interpreting the findings. First, the framework primarily relies on static GTFS data, which describe scheduled transit services rather than observed passenger demand or actual operating conditions. Consequently, the diagnostic indicators cannot independently establish experienced service reliability, passenger waiting times, or demand-related deficiencies. Similarly, the waiting-time indicator extracted from SUMO does not represent actual passenger waiting time. Future research should incorporate observed passenger demand, origin–destination information, and real-time operational data to strengthen the empirical basis of service evaluation and intervention assessment.
Second, the microsimulation model was developed using an OpenStreetMap-derived road network, with transit routes reconstructed through shortest-path algorithms. This approximation may differ from actual bus trajectories and operating conditions. Moreover, eight of the 271 GTFS stops could not be matched to the simulation network, and the model was not independently calibrated against observed traffic counts, vehicle trajectories, or realised travel times. These factors introduce uncertainty regarding the correspondence between simulated and real-world operations. Future studies should improve network-matching procedures and incorporate observed traffic and transit operating data for simulation calibration and validation.
Third, although the generated intervention scenarios satisfied the predefined technical validation criteria, their practical implementation feasibility was not comprehensively evaluated. In particular, fleet availability, driver scheduling, operating expenditure, and institutional constraints were not explicitly incorporated into the scenario assessment. Therefore, technical validity and simulated operational improvements do not necessarily establish implementation readiness. Future research should integrate fleet and resource constraints, economic appraisal, and multi-objective optimisation to examine the balance between service improvements and operational requirements.
Fourth, the evaluation of LLM performance relied on study-defined diagnostic and scenario-quality rubrics, while output consistency was examined through five repeated runs. Although these procedures enabled structured comparisons, the resulting scores do not constitute independent ground-truth validation of diagnostic accuracy or intervention quality. Additionally, the observed computational efficiency reflects the specific cloud inference configuration used in this study. Future investigations should incorporate independent expert assessments, additional experimental repetitions, sensitivity analysis, and alternative inference environments to improve evaluation robustness.
Finally, the framework was demonstrated using a single public bus network in Johor Bahru, Malaysia. Differences in network structure, data availability, passenger travel patterns, and institutional conditions may influence its applicability to other transit systems. Accordingly, the generalisability and scalability of the framework remain to be established through broader empirical applications. Future studies should evaluate TransitSim-LLM across multiple cities and transit networks to examine its adaptability and transferability under diverse operating conditions.
Addressing these limitations would strengthen the empirical validity, operational relevance, and practical applicability of TransitSim-LLM while supporting its further development as an evidence-informed transit planning tool.
Data availability statement
The raw data supporting the conclusions of this article will be made available by the authors, without undue reservation.
Author contributions
MH: Conceptualization, Data curation, Formal Analysis, Methodology, Validation, Visualization, Writing – original draft, Writing – review and editing. TT: Data Curation, Visualization, Writing – Original Draft, Writing – Review and Editing.
Conflict of interest
The author(s) declared that this work was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.
Generative AI statement
The author(s) declared that generative AI was used in the creation of this manuscript. The authors declare that generative artificial intelligence was used during the preparation of this manuscript. ChatGPT 5.5 was used solely to improve the language, grammar, clarity, and readability of the manuscript. All AI-assisted content was critically reviewed and revised by the authors, who take full responsibility for the accuracy, integrity, and content of the article.
Any alternative text (alt text) provided alongside figures in this article has been generated by Frontiers with the support of artificial intelligence and reasonable efforts have been made to ensure accuracy, including review by the authors wherever possible. If you identify any issues, please contact us.
Publisher’s note
All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.
References
- Almselati A. S. I. Rahmat R. Jaafar O. (2011). An overview of urban transport in Malaysia. Soc. Sci. 6 (1), 24–33.
- Antrim A. Barbeau S. J. (2013). “The many uses of GTFS data: opening the door to transit and multimodal applications,” in ITS America’s 23rd Annual Meeting and Exposition. Available online at: https://www.locationaware.usf.edu/wp-content/uploads/2010/02/The-Many-Uses-of-GTFS-Data-%E2%80%93-ITS-America-submission-abbreviated.pdf (Accessed October 30, 2026).
- Bai J. Bai S. Chu Y. Cui Z. Dang K. Deng X. et al. (2023). Qwen technical report. arXiv preprint arXiv:2309.16609.
- Boeing G. (2017). OSMnx: new methods for acquiring, constructing, analyzing, and visualizing complex street networks. Comput. Environ. Urban Syst. 65, 126–139.
- Brown T. B. Mann B. Ryder N. Subbiah M. Kaplan J. D. Dhariwal P. et al. (2020). Language models are few-shot learners. Adv. Neural Inf. Process. Syst. 33, 1877–1901. Available online at: https://proceedings.neurips.cc/paper/2020/hash/1457c0d6bfcb4967418bfb8ac142f64a-Abstract.html (Accessed October 30, 2026).
- Cats O. West J. Eliasson J. (2016). A dynamic stochastic model for evaluating congestion and crowding effects in transit systems. Transp. Res. Part B Methodol. 89, 43–57.
- Ceder A. (2016). Public Transit Planning and Operation: Modeling, Practice and Behavior. 2nd ed. Boca Raton, FL: CRC Press.
- Cervero R. Golub A. (2007). Informal transport: a global perspective. Transp. Policy 14 (6), 445–457.
- Currie G. (2010). Quantifying spatial gaps in public transport supply based on social needs. J. Transp. Geogr. 18 (1), 31–41.
- dell’Olio L. Ibeas A. Cecin P. (2011). The quality of service desired by public transport users. Transp. Policy 18 (1), 217–227.
- Desta R. Tóth J. (2021). Simulating the performance of integrated bus priority setups with microscopic traffic mockup experiments. Sci. Afr. 11, e00707.
- Devunuri S. Lehe L. (2025). TransitGPT: a generative AI-based framework for interacting with GTFS data using large language models. Public Transp. 17 (2), 319–345.
- Devunuri S. Qiam S. Lehe L. (2023). ChatGPT for GTFS: benchmarking LLMs on GTFS understanding and retrieval. arXiv preprint arXiv:2308.02618.
- El-Geneidy A. Grimsrud M. Wasfi R. Tétreault P. Surprenant-Legault J. (2014). New evidence on walking distances to transit stops: identifying redundancies and gaps using variable service areas. Transportation 41 (1), 193–210.
- Eros E. Mehndiratta S. Zegras C. Webb K. Ochoa M. C. (2014). Applying the general transit feed specification to the global south: experiences in Mexico City, Mexico—and beyond. Transp. Res. Rec. 2442 (1), 44–52.
- Farahani R. Z. Miandoabchi E. Szeto W. Y. Rashidi H. (2013). A review of urban transportation network design problems. Eur. J. Operational Res. 229 (2), 281–302.
- Guihaire V. Hao J. K. (2008). Transit network design and scheduling: a global review. Transp. Res. Part A Policy Pract. 42 (10), 1251–1273.
- Hassan M. Kabir M. E. Jusoh M. Ki An H. Negnevitsky M. Li C. (2025a). Large language models in transportation: a comprehensive bibliometric analysis of emerging trends, challenges, and future research. IEEE Access 13, 132547–132598.
- Hassan M. Mahin H. D. Ahmed F. Hassan M. M. Rahaman A. Abdullah M. (2025b). Assessing public transit network efficiency and accessibility in johor bahru and penang, Malaysia: a data-driven approach. Results Eng. 27, 106126.
- Hensher D. A. Mulley C. Yahya N. (2010). Passenger experience with quality-enhanced bus service: the tyne and wear ‘superoute’services. Transportation 37 (2), 239–256.
- Ibarra-Rojas O. J. Delgado F. Giesen R. Muñoz J. C. (2015). Planning, operation, and control of bus transport systems: a literature review. Transp. Res. Part B Methodol. 77, 38–75.
- Iles R. (2005). Public Transport in Developing Countries. Bingley, United Kingdom: Emerald Group Publishing Limited.
- Jeong M. Chang J. Yoon Y. (2025). “Speak to simulate: an LLM-guided agentic framework for traffic simulation in SUMO,” in Proceedings of the 8th ACM SIGSPATIAL International Workshop on Geospatial Simulation.
- Jiang A. Q. Sablayrolles A. Mensch A. Bamford C. Chaplot D. S. de las Casas D. et al. (2023). Mistral 7b. Available online at: https://arxiv.org/abs/2310.06825 (Accessed October 30, 2026).
- Jonnala R. Liang G. Yang J. Alsmadi I. (2025). Exploring the potential of large language models in public transportation: san antonio case study. arXiv preprint arXiv:2501.03904.
- Kieu L. M. Bhaskar A. Chung E. (2015). Public transport travel-time variability definitions and monitoring. J. Transp. Eng. 141 (1), 04014068.
- Krajzewicz D. Erdmann J. Behrisch M. Bieker L. (2012). Recent development and applications of SUMO – simulation of urban mobility. Int. J. Adv. Syst. Meas. 5 (3–4), 128–138. Available online at: https://sumo.dlr.de/pdf/sysmea_v5_n34_2012_4.pdf (Accessed October 30, 2026).
- Li S. Azfar T. Ke R. (2024). Chatsumo: large language model for automating traffic scenario generation in simulation of urban mobility. IEEE Trans. Intelligent Veh. 10, 4962–4973.
- Liu D. Guo J. Gu Y. King M. Han L. D. Brakewood C. (2025). Analyzing transit systems using general transit feed specification (gtfs) by generating spatiotemporal transit networks. Information 16 (1), 24.
- Lopez P. A. Behrisch M. Bieker-Walz L. Erdmann J. Flötteröd Y. P. Hilbrich R. et al. (2018). “Microscopic traffic simulation using SUMO,” in Proceedings of the IEEE International Conference on Intelligent Transportation Systems (ITSC), 2575–2582.
- Mandl C. E. (1980). Evaluation and optimization of urban public transportation networks. Eur. J. Operational Res. 5 (6), 396–404.
- Muromachi Y. Lim I. Wicaksono A. Vergel K. N. Choocharukul K. Tan V. H. et al. (2015). A comparative study on road-based urban public transport policies in six asian countries from the viewpoint of governance, urban planning, and financial aspects. J. East. Asia Soc. Transp. Stud. 11, 1433–1450.
- Nguyen M. H. Ha T. T. Tu S. S. Nguyen T. C. (2019). Impediments to the bus rapid transit implementation in developing countries–a typical evidence from hanoi. Int. J. Urban Sci. 23 (4), 464–483.
- Redman L. Friman M. Gärling T. Hartig T. (2013). Quality attributes of public transport that attract car users: a research review. Transp. Policy 25, 119–127.
- Tirachini A. Godachevich J. Cats O. Muñoz J. C. Soza-Parra J. (2022). Headway variability in public transport: a review of metrics, determinants, effects for quality of service and control strategies. Transp. Rev. 42 (3), 337–361.
- Touvron H. Martin L. Stone K. Albert P. Almahairi A. Babaei Y. et al. (2023). Llama 2: open foundation and fine-tuned chat models. Available online at: https://arxiv.org/abs/2307.09288 (Accessed October 30, 2026).
- Transportation Research Board (2013). TCRP Report 165: Transit Capacity and Quality of Service Manual. Washington, DC: Transportation Research Board.
- Vaswani A. Shazeer N. Parmar N. Uszkoreit J. Jones L. Gomez A. N. et al. (2017). Attention is all you need. Adv. Neural Inf. Process. Syst. 30, 5998–6008. Available online at: https://proceedings.neurips.cc/paper/7181-attention-is-all-you-need (Accessed October 30, 2026).
- Walker J. (2024). Human Transit, Revised Edition: How Clearer Thinking About Public Transit can Enrich our Communities and our Lives. Washington, DC: Island Press.
- Wandelt S. Zheng C. Wang S. Liu Y. Sun X. (2024). Large language models for intelligent transportation: a review of the state of the art and challenges. Appl. Sci. 14 (17), 7455.
- Welch T. F. Mishra S. (2013). A measure of equity for public transit connectivity. J. Transp. Geogr. 33, 29–41.
- Ye C. Xiong G. Shang J. Dai X. Gong X. Lv Y. (2025). SUMO-MCP: leveraging the model context protocol for autonomous traffic simulation and optimization. arXiv preprint arXiv:2506.03548.
- Zhao W. X. Zhou K. Li J. Tang T. Wang X. Hou Y. et al. (2023). A survey of large language models. arXiv preprint arXiv:2303.18223.
Notes
Edited by: Anas AlSobeh, Utah Valley University, United States
Reviewed by: Avani Aravind, Atkinsrealis, United States Tamene Taye Worku, Addis Ababa University, Ethiopia