{"id":29830847,"url":"https://github.com/avijit-jana/seqflipattention","last_synced_at":"2026-05-10T03:02:01.238Z","repository":{"id":306619713,"uuid":"970259309","full_name":"Avijit-Jana/SeqFlipAttention","owner":"Avijit-Jana","description":"SeqFlipAttention is a forward‑looking PyTorch demonstration of sequence‑to‑sequence learning enhanced by attention, trained on a synthetic reverse‑sequence task and complete with training scripts, loss and accuracy visualizations, and a quantitative analysis of attention’s impact on performance.","archived":false,"fork":false,"pushed_at":"2025-07-26T15:35:26.000Z","size":30981,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-26T20:52:29.965Z","etag":null,"topics":["attention-mechanism","deep-learning","deeplearning","machine-learning","machine-translation","model-evaluation","modelevaluation","natural-language-processing","nlp","python","pytorch","seq2seq","synthetic-data","syntheticdata","text-generation"],"latest_commit_sha":null,"homepage":"https://github.com/Avijit-Jana/SeqFlipAttention","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Avijit-Jana.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-21T18:24:15.000Z","updated_at":"2025-07-26T15:35:30.000Z","dependencies_parsed_at":"2025-07-26T21:03:07.999Z","dependency_job_id":null,"html_url":"https://github.com/Avijit-Jana/SeqFlipAttention","commit_stats":null,"previous_names":["avijit-jana/seqflipattention"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Avijit-Jana/SeqFlipAttention","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Avijit-Jana%2FSeqFlipAttention","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Avijit-Jana%2FSeqFlipAttention/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Avijit-Jana%2FSeqFlipAttention/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Avijit-Jana%2FSeqFlipAttention/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Avijit-Jana","download_url":"https://codeload.github.com/Avijit-Jana/SeqFlipAttention/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Avijit-Jana%2FSeqFlipAttention/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267668847,"owners_count":24124973,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["attention-mechanism","deep-learning","deeplearning","machine-learning","machine-translation","model-evaluation","modelevaluation","natural-language-processing","nlp","python","pytorch","seq2seq","synthetic-data","syntheticdata","text-generation"],"created_at":"2025-07-29T10:11:59.379Z","updated_at":"2026-05-10T03:02:01.225Z","avatar_url":"https://github.com/Avijit-Jana.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# 🔁 Sequence-to-Sequence Modeling with Attention\n\nA focused, hands-on project that demonstrates how **attention mechanisms** enhance sequence-to-sequence (Seq2Seq) models by solving a simple but revealing learning task: **sequence reversal**.\n\n![GitHub repo size](https://img.shields.io/github/repo-size/Avijit-Jana/SeqFlipAttention?style=plastic)\n![GitHub language count](https://img.shields.io/github/languages/count/Avijit-Jana/SeqFlipAttention?style=plastic)\n![GitHub top language](https://img.shields.io/github/languages/top/Avijit-Jana/SeqFlipAttention?style=plastic)\n![GitHub last commit](https://img.shields.io/github/last-commit/Avijit-Jana/SeqFlipAttention?color=red\\\u0026style=plastic)\n\n\u003c/div\u003e\n\n---\n\n## 🧠 Project Overview\n\nSequence-to-sequence models struggle with long-term dependencies when forced to compress an entire input into a single vector. **Attention mechanisms solve this bottleneck** by allowing the model to dynamically focus on relevant parts of the input sequence during decoding.\n\nThis project makes that idea concrete.\n\nYou train a Seq2Seq model with attention on a **synthetic but diagnostic task**: given a sequence of integers, predict the *reversed* sequence. While simple, this task clearly exposes whether the model truly learns alignment between input and output tokens.\n\n---\n\n## 🧑‍💼 Why This Matters (Business Relevance)\n\nAlthough the dataset is synthetic, the underlying mechanics directly transfer to real-world systems such as:\n\n* Machine translation pipelines\n* Text summarization engines\n* Conversational AI and chatbots\n* Speech recognition and transcription systems\n\nAny domain where input and output sequences differ in length or structure relies on the same principles demonstrated here.\n\n---\n\n## 📁 Dataset Explanation\n\nThe dataset is **synthetically generated** for clarity and control:\n\n* Each input sequence is a random list of integers\n* The target sequence is the exact **reverse** of the input\n\nThis setup removes noise from data complexity and isolates what we care about: whether the model can learn **token-level alignment** across time steps.\n\nBecause the correct output is deterministic, model behavior and failure modes are easy to interpret.\n\n---\n\n## 📊 Evaluation Metrics\n\nModel performance is evaluated using standard sequence-learning metrics:\n\n* **Loss** – Tracks how well the predicted sequence matches the target during training and validation\n* **Accuracy** – Measures exact token-level prediction correctness\n\nTogether, these metrics give a clear picture of convergence, generalization, and stability.\n\n---\n\n## 📈 Final Results\n\n![Loss and Accuracy Graph](Notebooks/Graph.png)\n\nThe training curves show steady loss reduction and accuracy improvement across epochs, indicating that the attention-based Seq2Seq model successfully learns the reversal mapping.\n\nThis behavior is precisely what attention is designed to enable: **robust alignment over sequences**, even as length increases.\n\n---\n\n## 🚩 How to Navigate the Project\n\nTo understand the full modeling and training workflow, refer to the detailed explanation here:\n\n➡️ **Approach Documentation:**\n[https://github.com/Avijit-Jana/SeqFlipAttention/blob/main/Approach.md](https://github.com/Avijit-Jana/SeqFlipAttention/blob/main/Approach.md)\n\nThis file walks through the architecture, training logic, and design decisions step by step.\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n![Developer](https://img.shields.io/badge/Developed%20By-Avijit_Jana-blueviolet?style=for-the-badge)\n\n\u003c/div\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favijit-jana%2Fseqflipattention","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favijit-jana%2Fseqflipattention","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favijit-jana%2Fseqflipattention/lists"}