Notebooks using the Hugging Face libraries 🤗
This report presents the forensic synthetic code analysis of huggingface/notebooks, a Jupyter Notebook project with 4,588 GitHub stars. SynthScan v2.0 examined 5,587 lines of code across 50 source files, recording 54 pattern matches distributed across 8 syntactic categories. The overall adjusted score of 10.5 places this repository in the Low 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).
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.
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.
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.
The scanner identified 54 distinct pattern matches across 8 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.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | longform-qa/lfqa_utils.py | 3 | CODE | |
| LOW | longform-qa/lfqa_utils.py | 13 | CODE | |
| LOW | longform-qa/lfqa_utils.py | 14 | CODE | |
| LOW | longform-qa/lfqa_utils.py | 16 | CODE | |
| LOW | longform-qa/lfqa_utils.py | 17 | CODE | |
| LOW | …age_classification_vision_transformer/scripts/train.py | 1 | CODE | |
| LOW | …age_classification_vision_transformer/scripts/train.py | 3 | CODE | |
| LOW | sagemaker/01_getting_started_pytorch/scripts/train.py | 4 | CODE | |
| LOW | sagemaker/01_getting_started_pytorch/scripts/train.py | 9 | CODE | |
| LOW | sagemaker/14_train_and_push_to_hub/scripts/train.py | 4 | CODE | |
| LOW | sagemaker/14_train_and_push_to_hub/scripts/train.py | 8 | CODE | |
| LOW | sagemaker/15_training_compiler/scripts/train.py | 4 | CODE | |
| LOW | sagemaker/15_training_compiler/scripts/train.py | 8 | CODE | |
| LOW | sagemaker/05_spot_instances/scripts/train.py | 4 | CODE | |
| LOW | sagemaker/05_spot_instances/scripts/train.py | 8 | CODE | |
| LOW | sagemaker/28_train_llms_with_qlora/scripts/run_clm.py | 1 | CODE | |
| LOW | sagemaker/28_train_llms_with_qlora/scripts/run_clm.py | 14 | CODE | |
| LOW | sagemaker/28_train_llms_with_qlora/scripts/run_clm.py | 14 | CODE | |
| LOW | …r/25_pytorch_fsdp_model_parallelism/scripts/run_clm.py | 1 | CODE | |
| LOW | sagemaker/24_train_bloom_peft_lora/scripts/inference.py | 2 | CODE | |
| LOW | sagemaker/06_sagemaker_metrics/scripts/train.py | 4 | CODE | |
| LOW | sagemaker/06_sagemaker_metrics/scripts/train.py | 9 | CODE | |
| LOW | sagemaker/26_document_ai_donut/scripts/train.py | 3 | CODE | |
| LOW | sagemaker/26_document_ai_donut/scripts/train.py | 3 | CODE | |
| LOW | sagemaker/26_document_ai_donut/scripts/train.py | 3 | CODE | |
| LOW | sagemaker/26_document_ai_donut/scripts/train.py | 15 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | utils/convert_doc_to_notebooks.py | 49 | def _move_to_next_non_empty_line(i): | CODE |
| LOW | utils/convert_doc_to_notebooks.py | 379 | def convert_rst_file_to_notebook( | STRING |
| LOW | longform-qa/lfqa_utils.py | 124 | def embed_sentences_checkpointed(self, input_ids, attention_mask, checkpoint_batch_size=-1): | CODE |
| LOW | longform-qa/lfqa_utils.py | 244 | def train_qa_retriever_joint_epoch(model, dataset_list, tokenizer, optimizer, scheduler, args, e=0): | CODE |
| LOW | longform-qa/lfqa_utils.py | 533 | def embed_passages_for_retrieval(passages, tokenizer, qa_embedder, max_length=128, device="cuda:0"): | CODE |
| LOW | longform-qa/lfqa_utils.py | 544 | def embed_questions_for_retrieval(q_ls, tokenizer, qa_embedder, device="cuda:0"): | CODE |
| LOW | longform-qa/lfqa_utils.py | 609 | def batch_query_qa_dense_index(questions, qa_embedder, tokenizer, wiki_passages, wiki_index, n_results=10): | CODE |
| LOW | longform-qa/lfqa_utils.py | 639 | def batch_query_qa_dense_index_nn(passages, qa_embedder, tokenizer, wiki_passages, wiki_index, n_results=10): | CODE |
| LOW | …r/25_pytorch_fsdp_model_parallelism/scripts/run_clm.py | 15 | def safe_save_model_for_hf_trainer(trainer: Trainer, tokenizer: AutoTokenizer, output_dir: str): | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | course/en/chapter13/grpo_format.py | 47 | CODE | |
| LOW | course/en/chapter13/grpo_format.py | 66 | CODE | |
| LOW | utils/convert_doc_to_notebooks.py | 42 | CODE | |
| LOW | utils/convert_doc_to_notebooks.py | 306 | CODE | |
| LOW | utils/convert_doc_to_notebooks.py | 379 | CODE | |
| LOW | …xamples/src/text-classification/train_using_s3_data.py | 51 | CODE | |
| LOW | …gemaker_examples/src/seq2seq/run_seq2seq_no_trainer.py | 383 | CODE | |
| LOW | …gemaker_examples/src/seq2seq/run_seq2seq_no_trainer.py | 474 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | …er/32_train_deploy_embedding_models/scripts/run_mnr.py | 65 | # Create a mapping of relevant document (1 in our case) for each query | COMMENT |
| MEDIUM | …er/32_train_deploy_embedding_models/scripts/run_mnr.py | 83 | # Create a sequential evaluator | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | sagemaker/14_train_and_push_to_hub/README.md | 1 | # SageMaker push to hf.co/models example | COMMENT |
| LOW | …xamples/src/text-classification/train_using_s3_data.py | 1 | # coding=utf-8 | COMMENT |
| LOW | …xamples/src/text-classification/train_using_s3_data.py | 21 | COMMENT | |
| LOW | …gemaker_examples/src/seq2seq/run_seq2seq_no_trainer.py | 1 | #!/usr/bin/env python | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | course/en/chapter13/grpo_format.py | 120 | # Display the results | COMMENT |
| LOW | course/en/chapter13/grpo_math.py | 120 | # Display the results | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | course/en/chapter13/grpo_math.py | 107 | except Exception: | CODE |
| LOW | …s/idefics_zero3_finetuning/idefics_zero3_finetuning.py | 59 | except Exception: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | longform-qa/lfqa_utils.py | 494 | CODE |