Repository Analysis

google-deepmind/gemma

Gemma open-weight LLM library, from Google DeepMind

25.9 Moderate AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of google-deepmind/gemma, a Python project with 5,702 GitHub stars. SynthScan v2.0 examined 41,918 lines of code across 230 source files, recording 756 pattern matches distributed across 15 syntactic categories. The overall adjusted score of 25.9 places this repository in the Moderate AI signal band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

25.9
Adjusted Score
25.9
Raw Score
100%
Time Factor
2026-08-26
Last Push
5.7K
Stars
Python
Language
41.9K
Lines of Code
230
Files
756
Pattern Hits
2026-08-29
Scan Date
0.23
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

Longitudinal tracking requires multiple scan runs. Once this repository is re-scanned after new commits land, this chart will visualise how the synthetic code signal evolves over time — enabling you to detect whether AI authorship is growing, stabilising, or being actively corrected by human engineers.

No multi-scan history yet — run the scanner again to build trend data.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 0HIGH 52MEDIUM 51LOW 653

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 756 distinct pattern matches across 15 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Cross-File Repetition48 hits · 240 pts
SeverityFileLineSnippetContext
HIGHgemma/research/t5gemma/modules.py0returns the scalar to multiply the query by before attention.STRING
HIGHgemma/gm/nn/_config.py0returns the scalar to multiply the query by before attention.STRING
HIGHgemma/gm/nn/gemma3n/_config.py0returns the scalar to multiply the query by before attention.STRING
HIGHgemma/gm/nn/_lora.py0kauldron keys when calling `kontext.get_from_keys_obj`.STRING
HIGHgemma/gm/nn/_policy.py0kauldron keys when calling `kontext.get_from_keys_obj`.STRING
HIGHgemma/gm/nn/_quantization.py0kauldron keys when calling `kontext.get_from_keys_obj`.STRING
HIGHgemma/gm/nn/_layers.py0einsum is a convenience module for parameterized tensor multiplication.STRING
HIGHgemma/gm/nn/gemma4/_layers.py0einsum is a convenience module for parameterized tensor multiplication.STRING
HIGHgemma/gm/nn/gemma3n/_layers.py0einsum is a convenience module for parameterized tensor multiplication.STRING
HIGHgemma/gm/nn/_transformer_like.py0output of the gemma model. attributes: logits: predicted logits of the model. cache: updated cache if the input cache isSTRING
HIGHgemma/gm/nn/_transformer.py0output of the gemma model. attributes: logits: predicted logits of the model. cache: updated cache if the input cache isSTRING
HIGHgemma/gm/nn/gemma4/_transformer.py0output of the gemma model. attributes: logits: predicted logits of the model. cache: updated cache if the input cache isSTRING
HIGHgemma/gm/nn/gemma3n/_transformer.py0output of the gemma model. attributes: logits: predicted logits of the model. cache: updated cache if the input cache isSTRING
HIGHgemma/gm/nn/_transformer_like.py0model information. used to auto-load the model tokenizer and params.STRING
HIGHgemma/gm/nn/_transformer.py0model information. used to auto-load the model tokenizer and params.STRING
HIGHgemma/gm/nn/gemma4/_transformer.py0model information. used to auto-load the model tokenizer and params.STRING
HIGHgemma/gm/nn/gemma3n/_transformer.py0model information. used to auto-load the model tokenizer and params.STRING
HIGHgemma/gm/nn/_transformer.py0gemma3n transformer class. attributes: return_last_only: if `true`, only compute and return the last token. otherwise, rSTRING
HIGHgemma/gm/nn/gemma4/_transformer.py0gemma3n transformer class. attributes: return_last_only: if `true`, only compute and return the last token. otherwise, rSTRING
HIGHgemma/gm/nn/gemma3n/_transformer.py0gemma3n transformer class. attributes: return_last_only: if `true`, only compute and return the last token. otherwise, rSTRING
HIGHgemma/gm/nn/_transformer.py0encode the text tokens, eventually including the vision embeddings.STRING
HIGHgemma/gm/nn/gemma4/_transformer.py0encode the text tokens, eventually including the vision embeddings.STRING
HIGHgemma/gm/nn/gemma3n/_transformer.py0encode the text tokens, eventually including the vision embeddings.STRING
HIGHgemma/gm/nn/_transformer.py0update the embeddings to include the vision embeddings.STRING
HIGHgemma/gm/nn/gemma4/_transformer.py0update the embeddings to include the vision embeddings.STRING
HIGHgemma/gm/nn/gemma3n/_transformer.py0update the embeddings to include the vision embeddings.STRING
HIGHgemma/gm/nn/_transformer.py0encode images into the same space as the text embeddings.STRING
HIGHgemma/gm/nn/gemma3n/_transformer.py0encode images into the same space as the text embeddings.STRING
HIGHgemma/gm/nn/gemma4/_transformer.py0encode images into the same space as the text embeddings.STRING
HIGHgemma/gm/nn/_transformer.py0merge `return_last_only` from the config and input.STRING
HIGHgemma/gm/nn/gemma4/_transformer.py0merge `return_last_only` from the config and input.STRING
HIGHgemma/gm/nn/gemma3n/_transformer.py0merge `return_last_only` from the config and input.STRING
HIGHgemma/gm/nn/_config.py0returns the list of attention types for every layers.STRING
HIGHgemma/gm/nn/gemma4/_config.py0returns the list of attention types for every layers.STRING
HIGHgemma/gm/nn/gemma3n/_config.py0returns the list of attention types for every layers.STRING
HIGHgemma/gm/nn/_modules.py0encodes the input tokens. args: x: input shape [seq_len, embed_dim] or [batch_size, seq_len, embed_dim]. t: input tokensSTRING
HIGHgemma/gm/nn/gemma4/_modules.py0encodes the input tokens. args: x: input shape [seq_len, embed_dim] or [batch_size, seq_len, embed_dim]. t: input tokensSTRING
HIGHgemma/gm/nn/gemma3n/_modules.py0encodes the input tokens. args: x: input shape [seq_len, embed_dim] or [batch_size, seq_len, embed_dim]. t: input tokensSTRING
HIGHgemma/gm/nn/_modules.py0decodes the input vectors. args: x: array of shape [seq_len, embed_dim] or [batch_size, seq_len, embed_dim]. returns: arSTRING
HIGHgemma/gm/nn/gemma4/_modules.py0decodes the input vectors. args: x: array of shape [seq_len, embed_dim] or [batch_size, seq_len, embed_dim]. returns: arSTRING
HIGHgemma/gm/nn/gemma3n/_modules.py0decodes the input vectors. args: x: array of shape [seq_len, embed_dim] or [batch_size, seq_len, embed_dim]. returns: arSTRING
HIGHgemma/gm/nn/_modules.py0applies multi-head attention to the inputs. args: x: input sequence of shape [batch_size, seq_len, embed_dim]. segment_pSTRING
HIGHgemma/gm/nn/gemma4/_modules.py0applies multi-head attention to the inputs. args: x: input sequence of shape [batch_size, seq_len, embed_dim]. segment_pSTRING
HIGHgemma/gm/nn/gemma3n/_modules.py0applies multi-head attention to the inputs. args: x: input sequence of shape [batch_size, seq_len, embed_dim]. segment_pSTRING
HIGHgemma/gm/nn/_modules.py0applies the feed forward module. args: x: input sequence of shape [batch_size, seq_len, features]. returns: output sequeSTRING
HIGHgemma/gm/nn/gemma4/_modules.py0applies the feed forward module. args: x: input sequence of shape [batch_size, seq_len, features]. returns: output sequeSTRING
HIGHgemma/gm/nn/gemma4/vision/_modules.py0applies the feed forward module. args: x: input sequence of shape [batch_size, seq_len, features]. returns: output sequeSTRING
HIGHgemma/gm/nn/gemma3n/_modules.py0applies the feed forward module. args: x: input sequence of shape [batch_size, seq_len, features]. returns: output sequeSTRING
Hyper-Verbose Identifiers223 hits · 222 pts
SeverityFileLineSnippetContext
LOWgemma/research/t5gemma/config.py273 def get_checkpoint_from_kaggle(CODE
LOWgemma/research/t5gemma/t5gemma.py95 def compute_encoder_activations(CODE
LOWgemma/research/t5gemma/t5gemma.py110 def compute_decoder_activations(CODE
LOWgemma/research/t5gemma/t5gemma.py212def make_bidirectional_attn_mask(CODE
LOWgemma/research/t5gemma/t5gemma.py220def build_positions_from_mask(CODE
LOWgemma/research/t5gemma/sampling.py298 def _normalized_forbidden_tokens(self) -> tuple[int, ...] | None:CODE
LOWgemma/research/t5gemma/sampling.py553def _mask_tokens_after_end_tokens(CODE
LOWgemma/diffusion/_models_test.py26 def test_can_instantiate_from_default_config(self):CODE
LOWgemma/diffusion/_models_test.py31 def test_multiple_token_generation(self):CODE
LOWgemma/diffusion/_chat_sampler_test.py47 def test_chat_sampler_instantiation(self):CODE
LOWgemma/diffusion/_chat_sampler_test.py98 def test_chat_sampler_instantiation_overrides(self):CODE
LOWgemma/diffusion/_sampler_test.py349 def test_append_tokens_to_cache(self):CODE
LOWgemma/diffusion/_sampler_test.py427 def test_make_global_attention_no_cache(self):CODE
LOWgemma/diffusion/_sampler_test.py441 def test_make_global_attention_mask_batched_edge_cases(self):CODE
LOWgemma/diffusion/_sampler_test.py523 def test_make_global_attention_mask_with_full_attention_mask(self):CODE
LOWgemma/diffusion/_sampler_test.py577 def test_make_causal_attention_mask_no_cache(self):CODE
LOWgemma/diffusion/_sampler_test.py594 def test_make_causal_attention_mask_batched_edge_cases(self):CODE
LOWgemma/diffusion/_sampler_test.py681 def test_diffusion_sample_step_runs(self):CODE
LOWgemma/diffusion/_sampler_test.py890 def tracking_sample_next_canvas(*args, **kwargs):CODE
LOWgemma/diffusion/_sampler_test.py916 def test_sample_next_canvas_while_loop_matches_for_loop(self, use_cache):CODE
LOWgemma/diffusion/_sampler_test.py1001 def test_early_stopping_terminates_after_one_step(self):CODE
LOWgemma/diffusion/_sampler_test.py1091 def test_token_stability_early_stop(self):CODE
LOWgemma/diffusion/_early_stopping_test.py57 def test_stops_when_argmax_matches_previous(self):CODE
LOWgemma/diffusion/_early_stopping_test.py70 def test_does_not_stop_when_argmax_differs(self):CODE
LOWgemma/diffusion/_early_stopping_test.py83 def test_partial_mismatch_does_not_stop(self):CODE
LOWgemma/diffusion/_early_stopping_test.py96 def test_per_batch_independence(self):CODE
LOWgemma/diffusion/_early_stopping_test.py113 def test_stops_below_threshold(self):CODE
LOWgemma/diffusion/_early_stopping_test.py125 def test_does_not_stop_above_threshold(self):CODE
LOWgemma/diffusion/_early_stopping_test.py137 def test_exact_threshold_stops(self):CODE
LOWgemma/diffusion/_early_stopping_test.py154 def test_handles_zero_probability(self):CODE
LOWgemma/diffusion/_early_stopping_test.py166 def test_per_batch_independence(self):CODE
LOWgemma/diffusion/_early_stopping_test.py185 def test_requires_all_to_agree(self):CODE
LOWgemma/diffusion/_early_stopping_test.py204 def test_stops_when_all_agree(self):CODE
LOWgemma/diffusion/_transformer.py86 def call_with_self_conditioning( # pytype: disable=signature-mismatchCODE
LOWgemma/diffusion/_sampler.py49 def derivative_noise_probability(self, noise_proportion: Float) -> Float: # pyrefly: ignore[not-a-type]CODE
LOWgemma/diffusion/_sampler.py293def _truncate_canvas_at_stop_tokens(CODE
LOWgemma/diffusion/_sampler.py656def _make_global_attention_mask(CODE
LOWgemma/diffusion/_sampler.py702def _make_causal_attention_mask(CODE
LOWgemma/diffusion/_sampler.py762def _make_block_local_attention_mask(CODE
LOW…able_diffusion_adapter/hd/hd_gemma_ar_state_handler.py403 def create_conditioning_from_state(CODE
LOW…able_diffusion_adapter/hd/hd_gemma_ar_state_handler.py432def truncate_canvas_at_stop_tokens(CODE
LOW…iffusion/hackable_diffusion_adapter/hd/mask_helpers.py69def build_positions_from_mask(mask: Int['*B L']) -> Int['*B L']:CODE
LOW…iffusion/hackable_diffusion_adapter/hd/mask_helpers.py183def make_causal_attention_mask_right_pad(CODE
LOW…iffusion/hackable_diffusion_adapter/hd/mask_helpers.py247def create_decoder_attention_mask(CODE
LOW…sion/hackable_diffusion_adapter/hd/hd_gemma_network.py52def prefill_kv_cache_with_encoder(CODE
LOW…fusion/hackable_diffusion_adapter/hd/sft_model_test.py256def _init_and_run_sft_diffusion(CODE
LOW…fusion/hackable_diffusion_adapter/hd/sft_model_test.py504 def test_denoiser_sensitivity_to_prompt(self):CODE
LOW…fusion/hackable_diffusion_adapter/hd/sft_model_test.py564 def _make_inference_fn_and_conditioning(self, prompt_len=6, canvas_size=4):CODE
LOW…fusion/hackable_diffusion_adapter/hd/sft_model_test.py718 def test_inference_fn_produces_logits(self):CODE
LOW…fusion/hackable_diffusion_adapter/hd/sft_model_test.py731 def test_inference_fn_matches_bound_path(self):CODE
LOW…fusion/hackable_diffusion_adapter/hd/sft_model_test.py776 def test_inference_fn_sc_logits_squeeze(self):CODE
LOW…fusion/hackable_diffusion_adapter/hd/sft_model_test.py799 def test_inference_fn_sensitive_to_cache(self):CODE
LOW…fusion/hackable_diffusion_adapter/hd/sft_model_test.py994 def test_encoder_logits_gradient_flows_to_params(self):CODE
LOW…fusion/hackable_diffusion_adapter/hd/sft_model_test.py1069 def test_decoder_logits_gradient_flows_to_params(self):CODE
LOW…ckable_diffusion_adapter/hd/gemma_checkpointer_test.py45 def test_remap_strips_w_when_model_has_no_w(self):CODE
LOW…ckable_diffusion_adapter/hd/gemma_checkpointer_test.py101 def test_exact_match_no_remapping(self):CODE
LOW…ckable_diffusion_adapter/hd/gemma_checkpointer_test.py116 def test_checkpoint_only_keys_discarded(self):CODE
LOW…ckable_diffusion_adapter/hd/gemma_checkpointer_test.py166 def test_non_lora_model_only_keys_raise(self):CODE
LOW…ckable_diffusion_adapter/hd/gemma_checkpointer_test.py184 def test_w_suffix_not_stripped_when_both_paths_in_model(self):CODE
LOW…ckable_diffusion_adapter/hd/gemma_checkpointer_test.py233 def test_lora_and_checkpoint_only_combined(self):CODE
163 more matches not shown…
Over-Commented Block199 hits · 198 pts
SeverityFileLineSnippetContext
LOWgemma/__init__.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOWgemma/research/t5gemma/config.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOWgemma/research/t5gemma/t5gemma.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOWgemma/research/t5gemma/__init__.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOWgemma/research/t5gemma/sampling.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOWgemma/research/t5gemma/modules.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOWgemma/diffusion/_models_test.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOWgemma/diffusion/_chat_sampler_test.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOWgemma/diffusion/_sampler_test.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOWgemma/diffusion/_paths.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOWgemma/diffusion/_early_stopping_test.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOWgemma/diffusion/_chat_sampler.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOWgemma/diffusion/__init__.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOWgemma/diffusion/_transformer.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOWgemma/diffusion/_models.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOWgemma/diffusion/_sampler.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOWgemma/diffusion/_early_stopping.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOWgemma/diffusion/hackable_diffusion_adapter/eval_main.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOW…n/hackable_diffusion_adapter/checkpointed_evaluator.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOW…ma/diffusion/hackable_diffusion_adapter/safe_writer.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOW…able_diffusion_adapter/hd/hd_gemma_ar_state_handler.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOW…a/diffusion/hackable_diffusion_adapter/hd/sft_model.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOW…a/diffusion/hackable_diffusion_adapter/hd/sft_model.py301 """COMMENT
LOW…iffusion/hackable_diffusion_adapter/hd/mask_helpers.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOW…sion/hackable_diffusion_adapter/hd/hd_gemma_network.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOW…fusion/hackable_diffusion_adapter/hd/sft_model_test.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOW…ckable_diffusion_adapter/hd/gemma_checkpointer_test.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOW…diffusion_adapter/hd/hd_gemma_ar_state_handler_test.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOW…on/hackable_diffusion_adapter/hd/gemma_checkpointer.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOW…on/hackable_diffusion_adapter/hd/gemma_checkpointer.py81 """COMMENT
LOW…ion/hackable_diffusion_adapter/hd/mask_helpers_test.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOWgemma/diffusion/hackable_diffusion_adapter/hd/lora.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOW…a/diffusion/hackable_diffusion_adapter/hd/lora_test.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOW…ion/hackable_diffusion_adapter/configs/sft_pubmedqa.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOW…usion/hackable_diffusion_adapter/configs/sft_sudoku.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOW…/hackable_diffusion_adapter/configs/sft_sudoku_test.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOW…ackable_diffusion_adapter/configs/sft_pubmedqa_test.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOW…/hackable_diffusion_adapter/configs/sft_sudoku_full.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOW…ffusion/hackable_diffusion_adapter/eval/sudoku_eval.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOW…on/hackable_diffusion_adapter/eval/base_metric_test.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOW…on/hackable_diffusion_adapter/eval/sudoku_eval_test.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOW…usion/hackable_diffusion_adapter/eval/pubmedqa_eval.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOW…/hackable_diffusion_adapter/eval/pubmedqa_eval_test.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOW…ffusion/hackable_diffusion_adapter/eval/base_metric.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOW…ffusion/hackable_diffusion_adapter/eval/text_metric.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOW…on/hackable_diffusion_adapter/eval/text_metric_test.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOW…a/diffusion/hackable_diffusion_adapter/eval/ar_eval.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOW…diffusion/hackable_diffusion_adapter/data/data_test.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOWgemma/diffusion/hackable_diffusion_adapter/data/data.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOW…/hackable_diffusion_adapter/data/sudoku/sudoku_data.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOW…ckable_diffusion_adapter/data/sudoku/convert_sudoku.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOW…able_diffusion_adapter/data/sudoku/sudoku_data_test.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOW…kable_diffusion_adapter/data/pubmedqa/pubmedqa_data.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOW…_diffusion_adapter/data/pubmedqa/pubmedqa_data_test.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOW…le_diffusion_adapter/data/pubmedqa/convert_pubmedqa.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOWgemma/peft/_interceptors_test.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOWgemma/peft/_lora.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOWgemma/peft/_quantization_test.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOWgemma/peft/_quantization_utils.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
LOWgemma/peft/__init__.py1# Copyright 2026 DeepMind Technologies Limited.COMMENT
139 more matches not shown…
Unused Imports186 hits · 179 pts
SeverityFileLineSnippetContext
LOWgemma/research/t5gemma/__init__.py23CODE
LOWgemma/research/t5gemma/__init__.py24CODE
LOWgemma/research/t5gemma/__init__.py25CODE
LOWgemma/research/t5gemma/__init__.py28CODE
LOWgemma/research/t5gemma/__init__.py29CODE
LOWgemma/research/t5gemma/__init__.py30CODE
LOWgemma/research/t5gemma/__init__.py31CODE
LOWgemma/research/t5gemma/__init__.py34CODE
LOWgemma/diffusion/__init__.py24CODE
LOWgemma/diffusion/__init__.py27CODE
LOWgemma/diffusion/__init__.py30CODE
LOWgemma/diffusion/__init__.py31CODE
LOWgemma/diffusion/__init__.py34CODE
LOWgemma/diffusion/__init__.py35CODE
LOWgemma/diffusion/__init__.py36CODE
LOWgemma/diffusion/__init__.py39CODE
LOWgemma/diffusion/__init__.py40CODE
LOWgemma/diffusion/__init__.py43CODE
LOWgemma/diffusion/__init__.py44CODE
LOWgemma/diffusion/__init__.py45CODE
LOWgemma/diffusion/__init__.py48CODE
LOWgemma/diffusion/__init__.py49CODE
LOWgemma/diffusion/__init__.py50CODE
LOWgemma/diffusion/__init__.py51CODE
LOWgemma/diffusion/__init__.py52CODE
LOWgemma/diffusion/hackable_diffusion_adapter/eval_main.py21CODE
LOW…n/hackable_diffusion_adapter/checkpointed_evaluator.py21CODE
LOW…sion/hackable_diffusion_adapter/hd/hd_gemma_network.py25CODE
LOW…ffusion/hackable_diffusion_adapter/eval/sudoku_eval.py17CODE
LOW…usion/hackable_diffusion_adapter/eval/pubmedqa_eval.py17CODE
LOW…ffusion/hackable_diffusion_adapter/eval/base_metric.py17CODE
LOW…ffusion/hackable_diffusion_adapter/eval/text_metric.py17CODE
LOWgemma/diffusion/hackable_diffusion_adapter/data/data.py17CODE
LOW…kable_diffusion_adapter/data/pubmedqa/pubmedqa_data.py17CODE
LOWgemma/peft/_quantization_test.py22CODE
LOWgemma/peft/__init__.py20CODE
LOWgemma/peft/__init__.py21CODE
LOWgemma/peft/__init__.py24CODE
LOWgemma/peft/__init__.py25CODE
LOWgemma/peft/__init__.py26CODE
LOWgemma/peft/__init__.py27CODE
LOWgemma/peft/__init__.py28CODE
LOWgemma/peft/__init__.py29CODE
LOWgemma/peft/__init__.py30CODE
LOWgemma/peft/__init__.py31CODE
LOWgemma/peft/__init__.py32CODE
LOWgemma/peft/__init__.py33CODE
LOWgemma/peft/__init__.py36CODE
LOWgemma/peft/__init__.py37CODE
LOWgemma/peft/__init__.py38CODE
LOWgemma/peft/__init__.py39CODE
LOWgemma/peft/__init__.py40CODE
LOWgemma/peft/__init__.py41CODE
LOWgemma/peft/__init__.py42CODE
LOWgemma/peft/__init__.py43CODE
LOWgemma/peft/_tree_utils.py17CODE
LOWgemma/peft/_interceptors.py17CODE
LOWgemma/gm/__init__.py23CODE
LOWgemma/gm/__init__.py24CODE
LOWgemma/gm/__init__.py25CODE
126 more matches not shown…
Decorative Section Separators32 hits · 129 pts
SeverityFileLineSnippetContext
MEDIUMgemma/diffusion/hackable_diffusion_adapter/hd/lora.py57 # ── 1. All linear layers (default) ──────────────────────────────────COMMENT
MEDIUMgemma/diffusion/hackable_diffusion_adapter/hd/lora.py66 # ── 2. Attention-only LoRA ──────────────────────────────────────────COMMENT
MEDIUMgemma/diffusion/hackable_diffusion_adapter/hd/lora.py76 # ── 3. MLP-only LoRA ───────────────────────────────────────────────COMMENT
MEDIUMgemma/diffusion/hackable_diffusion_adapter/hd/lora.py86 # ── 4. Attention + MLP (everything inside transformer blocks) ──────COMMENT
MEDIUMgemma/diffusion/hackable_diffusion_adapter/hd/lora.py94 # ── 5. Specific layers only ────────────────────────────────────────COMMENT
MEDIUMgemma/diffusion/hackable_diffusion_adapter/hd/lora.py108 # ── 6. Combining layer and module filters ──────────────────────────COMMENT
MEDIUMgemma/diffusion/hackable_diffusion_adapter/hd/lora.py116 # ── 7. Query/Value only (classic LoRA recipe) ──────────────────────COMMENT
MEDIUMgemma/diffusion/hackable_diffusion_adapter/hd/lora.py123 # ── 8. Router projections only (MoE layers) ───────────────────────COMMENT
MEDIUM…a/diffusion/hackable_diffusion_adapter/hd/lora_test.py519# ---------------------------------------------------------------------------COMMENT
MEDIUM…a/diffusion/hackable_diffusion_adapter/hd/lora_test.py521# ---------------------------------------------------------------------------COMMENT
MEDIUM…a/diffusion/hackable_diffusion_adapter/hd/lora_test.py31# ---------------------------------------------------------------------------COMMENT
MEDIUM…a/diffusion/hackable_diffusion_adapter/hd/lora_test.py33# ---------------------------------------------------------------------------COMMENT
MEDIUM…a/diffusion/hackable_diffusion_adapter/hd/lora_test.py448# ---------------------------------------------------------------------------COMMENT
MEDIUM…a/diffusion/hackable_diffusion_adapter/hd/lora_test.py450# ---------------------------------------------------------------------------COMMENT
MEDIUM…on/hackable_diffusion_adapter/eval/sudoku_eval_test.py64# ---------------------------------------------------------------------------COMMENT
MEDIUM…on/hackable_diffusion_adapter/eval/sudoku_eval_test.py66# ---------------------------------------------------------------------------COMMENT
MEDIUM…on/hackable_diffusion_adapter/eval/sudoku_eval_test.py132# ---------------------------------------------------------------------------COMMENT
MEDIUM…on/hackable_diffusion_adapter/eval/sudoku_eval_test.py134# ---------------------------------------------------------------------------COMMENT
MEDIUM…on/hackable_diffusion_adapter/eval/sudoku_eval_test.py155# ---------------------------------------------------------------------------COMMENT
MEDIUM…on/hackable_diffusion_adapter/eval/sudoku_eval_test.py157# ---------------------------------------------------------------------------COMMENT
MEDIUM…on/hackable_diffusion_adapter/eval/sudoku_eval_test.py199# ---------------------------------------------------------------------------COMMENT
MEDIUM…on/hackable_diffusion_adapter/eval/sudoku_eval_test.py201# ---------------------------------------------------------------------------COMMENT
MEDIUM…on/hackable_diffusion_adapter/eval/sudoku_eval_test.py242# ---------------------------------------------------------------------------COMMENT
MEDIUM…on/hackable_diffusion_adapter/eval/sudoku_eval_test.py244# ---------------------------------------------------------------------------COMMENT
MEDIUM…on/hackable_diffusion_adapter/eval/sudoku_eval_test.py23# ---------------------------------------------------------------------------COMMENT
MEDIUM…on/hackable_diffusion_adapter/eval/sudoku_eval_test.py25# ---------------------------------------------------------------------------COMMENT
MEDIUM…on/hackable_diffusion_adapter/eval/sudoku_eval_test.py292# ---------------------------------------------------------------------------COMMENT
MEDIUM…on/hackable_diffusion_adapter/eval/sudoku_eval_test.py294# ---------------------------------------------------------------------------COMMENT
MEDIUM…on/hackable_diffusion_adapter/eval/sudoku_eval_test.py309# ---------------------------------------------------------------------------COMMENT
MEDIUM…on/hackable_diffusion_adapter/eval/sudoku_eval_test.py311# ---------------------------------------------------------------------------COMMENT
MEDIUMgemma/gm/nn/_lora_test.py107# ---------------------------------------------------------------------------COMMENT
MEDIUMgemma/gm/nn/_lora_test.py109# ---------------------------------------------------------------------------COMMENT
Self-Referential Comments16 hits · 38 pts
SeverityFileLineSnippetContext
MEDIUM…diffusion_adapter/hd/hd_gemma_ar_state_handler_test.py762 # Create a mock Kauldron contextCOMMENT
MEDIUM…able_diffusion_adapter/data/sudoku/sudoku_data_test.py26 # Create a serialized tf.train.ExampleCOMMENT
MEDIUM…_diffusion_adapter/data/pubmedqa/pubmedqa_data_test.py25 # Create a temporary JSONL fileCOMMENT
MEDIUMgemma/peft/_interceptors_test.py36 # Create an extra param.COMMENT
MEDIUMgemma/gm/nn/gemma4/vision/_images.py66 # Create a mask of all invalid positions by finding the zero valuesCOMMENT
MEDIUMgemma/gm/nn/gemma4/audio/_modules.py940 # This function is a streamlined re-implementation of tf.signal.frame withCOMMENT
MEDIUMgemma/gm/utils/_file_cache_test.py45 # Create the cache directory and write a file in it.COMMENT
MEDIUMgemma/gm/data/_tasks.py162 # Create the model inputs/targets/loss_mask.COMMENT
MEDIUMgemma/gm/data/_functional.py140 # Create the loss mask.COMMENT
MEDIUMexamples/sharding.py115 # Create the model inputs/targets/loss_mask.STRING
MEDIUMexamples/multimodal.py141 # Create a new constant fieldSTRING
MEDIUMexamples/multimodal.py143 # Create the model inputs/targets/loss_mask.STRING
MEDIUMexamples/npo.py117 # Create the model inputs/targets/mask.COMMENT
MEDIUMexamples/lora.py136 # Create the model inputs/targets/loss_mask.STRING
MEDIUMexamples/dpo.py107 # Create the model inputs and loss mask.COMMENT
MEDIUMexamples/seq2seq.py129 # Create the model inputs/targets/loss_mask.STRING
Docstring Block Structure4 hits · 20 pts
SeverityFileLineSnippetContext
HIGH…iffusion/hackable_diffusion_adapter/hd/mask_helpers.py95Creates a causal attention mask for right-padded prefill. Builds a lower-triangular causal mask, multiplied by ``tokeSTRING
HIGH…on/hackable_diffusion_adapter/hd/gemma_checkpointer.py57Remaps checkpoint keys and merges them into the model param dict. This is the core logic of checkpoint-to-model paramSTRING
HIGHgemma/diffusion/hackable_diffusion_adapter/hd/lora.py335Fuse LoRA weights into base weights, returning a base-only param tree. Takes a param tree that contains both base weiSTRING
HIGHgemma/gm/utils/_attention_mask.py29Make the attention mask for the transformer. Gemma transformer attention mask is a little complicated, as the text STRING
AI Structural Patterns19 hits · 18 pts
SeverityFileLineSnippetContext
LOWgemma/diffusion/_transformer.py78CODE
LOW…able_diffusion_adapter/hd/hd_gemma_ar_state_handler.py143CODE
LOW…diffusion_adapter/hd/hd_gemma_ar_state_handler_test.py93CODE
LOWgemma/gm/nn/gemma4/_moe.py214CODE
LOWgemma/gm/nn/gemma4/_moe.py242CODE
LOWgemma/gm/nn/gemma4/_moe.py379CODE
LOWgemma/gm/nn/gemma4/_moe.py407CODE
LOWgemma/gm/nn/gemma4/_transformer.py235CODE
LOWgemma/gm/nn/gemma4/vision/_modules.py210CODE
LOWgemma/gm/nn/gemma4/audio/_modules.py204CODE
LOWgemma/gm/utils/_jax_utils.py104CODE
LOWgemma/gm/text/_gemma4_sampler.py98CODE
LOWgemma/gm/text/_chat_sampler.py479CODE
LOWgemma/gm/text/_chat_sampler.py261CODE
LOWgemma/gm/text/_tool_sampler.py54CODE
LOWgemma/gm/text/_sampler.py169CODE
LOWgemma/gm/text/_sampler.py186CODE
LOWgemma/gm/text/_sampler.py204CODE
LOWgemma/gm/text/_sampler.py238CODE
Deep Nesting15 hits · 14 pts
SeverityFileLineSnippetContext
LOWgemma/research/t5gemma/modules.py631CODE
LOW…ffusion/hackable_diffusion_adapter/eval/sudoku_eval.py69CODE
LOW…ffusion/hackable_diffusion_adapter/eval/sudoku_eval.py351CODE
LOW…on/hackable_diffusion_adapter/eval/sudoku_eval_test.py317CODE
LOW…on/hackable_diffusion_adapter/eval/sudoku_eval_test.py321CODE
LOWgemma/gm/nn/gemma4/_config.py55CODE
LOWgemma/gm/nn/gemma4/audio/_model.py86CODE
LOWgemma/gm/nn/gemma3n/_config.py54CODE
LOWgemma/gm/ckpts/_checkpoint.py509CODE
LOWgemma/gm/ckpts/_checkpoint.py140CODE
LOWgemma/gm/ckpts/_compat.py112CODE
LOWgemma/gm/text/_chat_sampler.py261CODE
LOWgemma/gm/text/_tokenizer.py203CODE
LOWgemma/gm/text/_tokenizer.py264CODE
LOWgemma/gm/text/_tokenizer.py322CODE
Modern AI Meta-Vocabulary2 hits · 6 pts
SeverityFileLineSnippetContext
MEDIUMgemma/diffusion/_sampler.py824 # Combine: attend to context window OR canvas self-attention.COMMENT
MEDIUMexamples/classification.py118 # information, so even zero-shot prediction without anyCOMMENT
Verbosity Indicators3 hits · 6 pts
SeverityFileLineSnippetContext
LOWgemma/gm/nn/gemma4/vision/_images.py32 # Step 1: Calculate the target dimensions preserving aspect ratioCOMMENT
LOWgemma/gm/nn/gemma4/vision/_images.py44 # Step 2: Normalize image pixels to [0, 1] rangeCOMMENT
LOWgemma/gm/nn/gemma4/vision/_images.py47 # Step 3: Resize the image to the target dimensions using bicubicCOMMENT
Structural Annotation Overuse3 hits · 6 pts
SeverityFileLineSnippetContext
LOWgemma/gm/nn/gemma4/vision/_images.py32 # Step 1: Calculate the target dimensions preserving aspect ratioCOMMENT
LOWgemma/gm/nn/gemma4/vision/_images.py44 # Step 2: Normalize image pixels to [0, 1] rangeCOMMENT
LOWgemma/gm/nn/gemma4/vision/_images.py47 # Step 3: Resize the image to the target dimensions using bicubicCOMMENT
Fake / Example Data3 hits · 4 pts
SeverityFileLineSnippetContext
LOWgemma/gm/nn/vision/_vision.py99 dummy_data = jnp.copy(input_data)CODE
LOWgemma/gm/nn/vision/_vision.py101 dummy_data = dummy_data.at[jnp.arange(len(dummy_data)), position_offset].set(CODE
LOWgemma/gm/nn/vision/_vision.py105 dummy_data[jnp.arange(len(input_data)), start_positions + position_offset]CODE
AI Slop Vocabulary1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUMgemma/gm/nn/gemma4/audio/_modules.py940 # This function is a streamlined re-implementation of tf.signal.frame withCOMMENT
Excessive Try-Catch Wrapping2 hits · 2 pts
SeverityFileLineSnippetContext
LOW…n/hackable_diffusion_adapter/checkpointed_evaluator.py57except Exception:CODE
LOW…n/hackable_diffusion_adapter/checkpointed_evaluator.py64except Exception:CODE