Dataset Viewer
Auto-converted to Parquet Duplicate
focal_symbol
stringlengths
19
105
source_file
stringclasses
324 values
messages
listlengths
2
2
reward_info
dict
mobius.models.doge.DogeDecoderLayer.forward
src/mobius/models/doge.py
[ { "role": "system", "content": "You are an expert code assistant for the Mobius repository. Use the retrieved repository code snippets in Context to answer the Question accurately and write complete, idiomatic Mobius Python code. Submit your answer by calling the `step` tool once, with `response` set to you...
{ "target_identifiers": [ "_rope", "input_layernorm", "self_attn", "input_residual", "post_attention_residual" ], "reference_answer": "```python\ndef forward(\n self,\n op: OpBuilder,\n hidden_states: ir.Value,\n attention_bias: ir.Value | None,\n position_ids: ir.Value | None =...
mobius.models.kimi_k3.KimiK3DecoderLayer._mix
src/mobius/models/kimi_k3.py
[ { "role": "system", "content": "You are an expert code assistant for the Mobius repository. Use the retrieved repository code snippets in Context to answer the Question accurately and write complete, idiomatic Mobius Python code. Submit your answer by calling the `step` tool once, with `response` set to you...
{ "target_identifiers": [ "_mix", "OpBuilder", "DataType" ], "reference_answer": "```python\n@staticmethod\ndef _mix(\n op: OpBuilder,\n prefix_sum: ir.Value,\n bank: list[ir.Value],\n score: nn.Module,\n eps: float,\n):\n sources = [op.Unsqueeze(value, [2]) for value in (*bank, pref...
mobius.models.minicpmv4_6._MiniCPMVisionEncoderModel.forward
src/mobius/models/minicpmv4_6.py
[ { "role": "system", "content": "You are an expert code assistant for the Mobius repository. Use the retrieved repository code snippets in Context to answer the Question accurately and write complete, idiomatic Mobius Python code. Submit your answer by calling the `step` tool once, with `response` set to you...
{ "target_identifiers": [ "vision_tower", "embeddings", "patch_embedding", "merger" ], "reference_answer": "```python\ndef forward(\n self,\n op: OpBuilder,\n pixel_values: ir.Value,\n target_sizes: ir.Value,\n):\n pixel_values = op.CastLike(\n pixel_values,\n self.vis...
mobius.models.layoutlmv3.LayoutLMv3Model.preprocess_weights
src/mobius/models/layoutlmv3.py
[ { "role": "system", "content": "You are an expert code assistant for the Mobius repository. Use the retrieved repository code snippets in Context to answer the Question accurately and write complete, idiomatic Mobius Python code. Submit your answer by calling the `step` tool once, with `response` set to you...
{ "target_identifiers": [ "preprocess_weights", "_rename_layoutlmv3_weight", "items" ], "reference_answer": "```python\ndef preprocess_weights(\n self, state_dict: dict[str, torch.Tensor]\n) -> dict[str, torch.Tensor]:\n \"\"\"Rename HF LayoutLMv3 weights.\n\n After BERT attribute alignment, ...
mobius.integrations.compressed_tensors._loader.CompressedTensorsConfig.parse
src/mobius/integrations/compressed_tensors/_loader.py
[ { "role": "system", "content": "You are an expert code assistant for the Mobius repository. Use the retrieved repository code snippets in Context to answer the Question accurately and write complete, idiomatic Mobius Python code. Submit your answer by calling the `step` tool once, with `response` set to you...
{ "target_identifiers": [ "_normalize_config_value", "_SUPPORTED_VERSION_PREFIX", "_parse_group", "CompressedTensorsError" ], "reference_answer": "```python\n@classmethod\ndef parse(cls, value: object) -> CompressedTensorsConfig:\n value = _normalize_config_value(value)\n if not isinstance(v...
mobius.components._rms_norm.apply_rms_norm
src/mobius/components/_rms_norm.py
[ { "role": "system", "content": "You are an expert code assistant for the Mobius repository. Use the retrieved repository code snippets in Context to answer the Question accurately and write complete, idiomatic Mobius Python code. Submit your answer by calling the `step` tool once, with `response` set to you...
{ "target_identifiers": [ "apply_rms_norm", "OpBuilder", "RMSNormalization" ], "reference_answer": "```python\ndef apply_rms_norm(op: OpBuilder, x, weight, eps):\n \"\"\"Apply RMS normalization using the ONNX RMSNormalization op.\n\n Args:\n op: The OpBuilder for creating ONNX ops.\n ...
mobius.integrations.diffusers._configs.VAEConfig.from_diffusers
src/mobius/integrations/diffusers/_configs.py
[ { "role": "system", "content": "You are an expert code assistant for the Mobius repository. Use the retrieved repository code snippets in Context to answer the Question accurately and write complete, idiomatic Mobius Python code. Submit your answer by calling the `step` tool once, with `response` set to you...
{ "target_identifiers": [ "from_diffusers", "VAEConfig", "block_out_channels", "scaling_factor", "use_post_quant_conv" ], "reference_answer": "```python\n@classmethod\ndef from_diffusers(cls, config: dict) -> VAEConfig:\n \"\"\"Create a VAEConfig from a diffusers config dict.\"\"\"\n if ...
mobius.models.sortformer._Conv1d.forward
src/mobius/models/sortformer.py
[ { "role": "system", "content": "You are an expert code assistant for the Mobius repository. Use the retrieved repository code snippets in Context to answer the Question accurately and write complete, idiomatic Mobius Python code. Submit your answer by calling the `step` tool once, with `response` set to you...
{ "target_identifiers": [ "forward", "_kernel_size", "_padding", "_groups" ], "reference_answer": "```python\ndef forward(self, op: OpBuilder, x: ir.Value) -> ir.Value:\n return op.Conv(\n x,\n self.weight,\n self.bias,\n kernel_shape=[self._kernel_size],\n st...
mobius.models.qwen_image_vae._Resample.forward
src/mobius/models/qwen_image_vae.py
[ { "role": "system", "content": "You are an expert code assistant for the Mobius repository. Use the retrieved repository code snippets in Context to answer the Question accurately and write complete, idiomatic Mobius Python code. Submit your answer by calling the `step` tool once, with `response` set to you...
{ "target_identifiers": [ "forward", "_mode", "resample" ], "reference_answer": "```python\ndef forward(self, op: OpBuilder, x: ir.Value):\n # x: (B, C, T, H, W). Single-chunk image path: no temporal resampling.\n b_shape = op.Shape(x, start=0, end=1)\n c_shape = op.Shape(x, start=1, end=2)\n...
mobius.tasks._image_classification.ImageClassificationTask.build
src/mobius/tasks/_image_classification.py
[ { "role": "system", "content": "You are an expert code assistant for the Mobius repository. Use the retrieved repository code snippets in Context to answer the Question accurately and write complete, idiomatic Mobius Python code. Submit your answer by calling the `step` tool once, with `response` set to you...
{ "target_identifiers": [ "build", "_make_graph", "_make_model", "image_size", "num_channels" ], "reference_answer": "```python\ndef build(\n self,\n module: nn.Module,\n config: BaseModelConfig,\n) -> ModelPackage:\n batch = ir.SymbolicDim(\"batch\")\n\n image_size = getattr(co...
mobius._weight_utils.vlm_vision_weights
src/mobius/_weight_utils.py
[ { "role": "system", "content": "You are an expert code assistant for the Mobius repository. Use the retrieved repository code snippets in Context to answer the Question accurately and write complete, idiomatic Mobius Python code. Submit your answer by calling the `step` tool once, with `response` set to you...
{ "target_identifiers": [ "vlm_vision_weights", "torch.Tensor", "startswith", "replace" ], "reference_answer": "```python\ndef vlm_vision_weights(\n state_dict: dict[str, torch.Tensor],\n prefixes: tuple[str, ...],\n) -> dict[str, torch.Tensor]:\n \"\"\"Extract vision-tower weights for a ...
mobius.components._gemma3n_audio._Gemma3nAudioAttention._window_mask
src/mobius/components/_gemma3n_audio.py
[ { "role": "system", "content": "You are an expert code assistant for the Mobius repository. Use the retrieved repository code snippets in Context to answer the Question accurately and write complete, idiomatic Mobius Python code. Submit your answer by calling the `step` tool once, with `response` set to you...
{ "target_identifiers": [ "_window_mask", "_max_backward", "_max_forward" ], "reference_answer": "```python\ndef _window_mask(self, op: OpBuilder, seq_len: ir.Value) -> ir.Value:\n \"\"\"``[1, 1, T, T]`` bool: True where key ``j`` is in query ``i``'s window.\"\"\"\n zero = op.Constant(value_int=...
mobius.models.chatglm.ChatGLMCausalLMModel.preprocess_weights
src/mobius/models/chatglm.py
[ { "role": "system", "content": "You are an expert code assistant for the Mobius repository. Use the retrieved repository code snippets in Context to answer the Question accurately and write complete, idiomatic Mobius Python code. Submit your answer by calling the `step` tool once, with `response` set to you...
{ "target_identifiers": [ "preprocess_weights", "split_fused_qkv", "num_attention_heads", "num_key_value_heads", "head_dim" ], "reference_answer": "```python\ndef preprocess_weights(\n self, state_dict: dict[str, torch.Tensor]\n) -> dict[str, torch.Tensor]:\n renamed: dict[str, torch.Ten...
mobius.models.nemotron3_diarization._FeatureStacking.forward
src/mobius/models/nemotron3_diarization.py
[ { "role": "system", "content": "You are an expert code assistant for the Mobius repository. Use the retrieved repository code snippets in Context to answer the Question accurately and write complete, idiomatic Mobius Python code. Submit your answer by calling the `step` tool once, with `response` set to you...
{ "target_identifiers": [ "forward", "_factor", "_stacked_size", "projection" ], "reference_answer": "```python\ndef forward(self, op: OpBuilder, input_features: ir.Value) -> ir.Value:\n # input_features: [B, T, feat_in].\n sequence_length = op.Squeeze(op.Shape(input_features, start=1, end=2...
mobius.integrations.gguf._docs._runtime_blocker_evidence_table
src/mobius/integrations/gguf/_docs.py
[ { "role": "system", "content": "You are an expert code assistant for the Mobius repository. Use the retrieved repository code snippets in Context to answer the Question accurately and write complete, idiomatic Mobius Python code. Submit your answer by calling the `step` tool once, with `response` set to you...
{ "target_identifiers": [ "_runtime_blocker_evidence_table", "iter_runtime_blocker_evidence", "iter_artifact_blocker_evidence", "withheld_checks", "logical_parameter_count" ], "reference_answer": "```python\ndef _runtime_blocker_evidence_table() -> str:\n rows = [\n \"| Evidence ID |...
mobius.models.glm_moe_dsa.GlmMoeDsaAttention._unpack_past
src/mobius/models/glm_moe_dsa.py
[ { "role": "system", "content": "You are an expert code assistant for the Mobius repository. Use the retrieved repository code snippets in Context to answer the Question accurately and write complete, idiomatic Mobius Python code. Submit your answer by calling the `step` tool once, with `response` set to you...
{ "target_identifiers": [ "_unpack_past", "main_key_dim", "indexer_type", "index_head_dim", "v_head_dim" ], "reference_answer": "```python\ndef _unpack_past(self, op: OpBuilder, past_key_value: tuple):\n packed_key, packed_value = past_key_value\n key_tokens = op.Squeeze(packed_key, [1])...
mobius.components._conv._resolve_pads
src/mobius/components/_conv.py
[ { "role": "system", "content": "You are an expert code assistant for the Mobius repository. Use the retrieved repository code snippets in Context to answer the Question accurately and write complete, idiomatic Mobius Python code. Submit your answer by calling the `step` tool once, with `response` set to you...
{ "target_identifiers": [ "_resolve_pads", "padding", "pads" ], "reference_answer": "```python\ndef _resolve_pads(padding: int | tuple[int, int, int, int]) -> list[int]:\n \"\"\"Normalise a ``padding`` argument to the ONNX ``pads`` attribute layout.\n\n An ``int`` pads all four edges equally (Py...
mobius.components._ocr_encoders.Granite4WindowQFormerProjector._window
src/mobius/components/_ocr_encoders.py
[ { "role": "system", "content": "You are an expert code assistant for the Mobius repository. Use the retrieved repository code snippets in Context to answer the Question accurately and write complete, idiomatic Mobius Python code. Submit your answer by calling the `step` tool once, with `response` set to you...
{ "target_identifiers": [ "_window", "_hidden_size", "OpBuilder" ], "reference_answer": "```python\ndef _window(\n self,\n op: OpBuilder,\n hidden_states: ir.Value,\n *,\n side: int,\n window: int,\n) -> ir.Value:\n batch = op.Shape(hidden_states, start=0, end=1)\n hidden_state...
mobius.models.phi._Phi4MMSpeechModel.forward
src/mobius/models/phi.py
[ { "role": "system", "content": "You are an expert code assistant for the Mobius repository. Use the retrieved repository code snippets in Context to answer the Question accurately and write complete, idiomatic Mobius Python code. Submit your answer by calling the `step` tool once, with `response` set to you...
{ "target_identifiers": [ "forward", "encoder", "speech", "vision", "Where" ], "reference_answer": "```python\ndef forward(\n self,\n op: OpBuilder,\n audio_embeds: ir.Value,\n audio_sizes: ir.Value,\n audio_projection_mode: ir.Value,\n):\n # audio_sizes is plumbed for the I/...
mobius.tasks._phi4mm_multimodal.Phi4MMMultiModalTask.build
src/mobius/tasks/_phi4mm_multimodal.py
[ { "role": "system", "content": "You are an expert code assistant for the Mobius repository. Use the retrieved repository code snippets in Context to answer the Question accurately and write complete, idiomatic Mobius Python code. Submit your answer by calling the `step` tool once, with `response` set to you...
{ "target_identifiers": [ "_validate_components", "_build_vision", "_build_speech", "_build_embedding", "_build_decoder" ], "reference_answer": "```python\ndef build(\n self,\n module: nn.Module,\n config: ArchitectureConfig,\n) -> ModelPackage:\n self._validate_components(module)\...
mobius.integrations.gguf._config_mapping._validate_encoder_metadata
src/mobius/integrations/gguf/_config_mapping.py
[ { "role": "system", "content": "You are an expert code assistant for the Mobius repository. Use the retrieved repository code snippets in Context to answer the Question accurately and write complete, idiomatic Mobius Python code. Submit your answer by calling the `step` tool once, with `response` set to you...
{ "target_identifiers": [ "_validate_encoder_metadata", "ArchitectureConfig", "num_key_value_heads", "num_attention_heads" ], "reference_answer": "```python\ndef _validate_encoder_metadata(\n config: ArchitectureConfig,\n metadata: dict[str, Any],\n arch: str,\n) -> None:\n \"\"\"Valid...
mobius.models.nemo_rnnt.FastConformerEncoder._att_bias
src/mobius/models/nemo_rnnt.py
[ { "role": "system", "content": "You are an expert code assistant for the Mobius repository. Use the retrieved repository code snippets in Context to answer the Question accurately and write complete, idiomatic Mobius Python code. Submit your answer by calling the `step` tool once, with `response` set to you...
{ "target_identifiers": [ "_att_bias", "_chunk_size", "_left_chunks" ], "reference_answer": "```python\ndef _att_bias(self, op: OpBuilder, t: ir.Value, valid: ir.Value) -> ir.Value:\n # chunk_idx[i] = floor(i / chunk_size); keep iff\n # 0 <= chunk_idx[i] - chunk_idx[j] <= left_chunks\n t_s = ...
End of preview. Expand in Data Studio

Mobius RAG + Unit-Test RL

Repository-specific coding tasks for reinforcement learning on Mobius at commit 0cc842f3. Each task asks a model to implement one function, method or class of Mobius from five code chunks retrieved from other Mobius files, and existing Mobius unit tests grade the answer. It is the dataset of the mobius_rag_rl environment in the Microsoft Foundry fine-tuning cookbook.

Files

File Contents
train.jsonl.gz 2,219 training tasks
validation.jsonl.gz 554 validation tasks, from source files that training tasks neither come from nor retrieve
mobius.tar Mobius source at 0cc842f3 (MIT License), which the unit tests run against

Fields

  • focal_symbol: dotted name of the definition to implement, such as mobius.integrations.gguf._quant_registry._dequantize_verdict.
  • source_file: the file that defines it.
  • messages: the system prompt and the user prompt, which holds the five retrieved code chunks and the question.
  • reward_info.target_identifiers: 1 to 5 identifiers (median 4) a correct answer uses.
  • reward_info.reference_answer: the original definition.
  • reward_info.unit_test_nodeids: 1 to 12 pytest node IDs (median 9) of existing tests that fail when the definition is broken.

How It Was Built

  1. Focal definitions. Every function, method and method-less class in src/ with 10 to 120 non-blank lines (except __init__ and classes whose methods are separate definitions). Every top-level definition and method is also a retrieval chunk (7,774 chunks).
  2. Unit tests. All *_test.py files ran once under a Python sys.monitoring call trace, offline and without a Hugging Face cache. For each definition, up to 24 passing tests that call it ran again with the definition replaced by raise RuntimeError; up to 12 that then failed became its unit_test_nodeids. Definitions without such tests were dropped (2,850 remained).
  3. Questions. gpt-6.1-sol received up to 6 definitions from one file and 3 related definitions from other files, and wrote one implementation question and up to 5 target identifiers per definition, keeping identifiers that occur in the original definition. The signature and any 2- to 6-digit constants were appended when a question omitted them. 2,773 definitions received a question.
  4. Retrieval. Code chunks and questions were embedded with text-embedding-3-small; each question has the 5 most similar chunks from other files (up to 2,000 characters each).
  5. Splits. Files are split by a hash of their name (one in five to validation; foo.py and _foo.py together), and training prompts never retrieve validation files.

Reward

The environment replaces the definition in mobius.tar with the answer's definition, runs unit_test_nodeids, and scores 0.70 * unit-test pass fraction + 0.20 * static score + 0.10 * context bonus. The static score combines identifier recall, presence of all target identifiers, AST call and attribute F1 against the reference, and conciseness; the context bonus is 1 below 32K context tokens. Answers that are not valid Python or do not define the focal symbol score 0.

Downloads last month
88