Views
No views yet
SentenceTransformer(
(0): Transformer({'max_seq_length': 256, 'do_lower_case': False}) with Transformer model: BertModel
(1): Pooling({'word_embedding_dimension': 384, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
(2): Normalize()
)pip install -U sentence-transformers1from sentence_transformers import SentenceTransformer
2
3# Download from the 🤗 Hub
4model = SentenceTransformer("danicafisher/dfisher-base-sentence-transformer")
5# Run inference
6sentences = [
7 'How can organizations address risks associated with the use of third-party data for GAI model inputs?',
8 '48 \n• Data protection \n• Data retention \n• Consistency in use of defining key terms \n• Decommissioning \n• Discouraging anonymous use \n• Education \n• Impact assessments \n• Incident response \n• Monitoring \n• Opt-outs \n• Risk-based controls \n• Risk mapping and measurement \n• Science-backed TEVV practices \n• Secure software development practices \n• Stakeholder engagement \n• Synthetic content detection and \nlabeling tools and techniques \n• Whistleblower protections \n• Workforce diversity and \ninterdisciplinary teams\nEstablishing acceptable use policies and guidance for the use of GAI in formal human-AI teaming settings \nas well as different levels of human-AI configurations can help to decrease risks arising from misuse, \nabuse, inappropriate repurpose, and misalignment between systems and users. These practices are just \none example of adapting existing governance protocols for GAI contexts. \nA.1.3. Third-Party Considerations \nOrganizations may seek to acquire, embed, incorporate, or use open-source or proprietary third-party \nGAI models, systems, or generated data for various applications across an enterprise. Use of these GAI \ntools and inputs has implications for all functions of the organization – including but not limited to \nacquisition, human resources, legal, compliance, and IT services – regardless of whether they are carried \nout by employees or third parties. Many of the actions cited above are relevant and options for \naddressing third-party considerations. \nThird party GAI integrations may give rise to increased intellectual property, data privacy, or information \nsecurity risks, pointing to the need for clear guidelines for transparency and risk management regarding \nthe collection and use of third-party data for model inputs. Organizations may consider varying risk \ncontrols for foundation models, fine-tuned models, and embedded tools, enhanced processes for \ninteracting with external GAI technologies or service providers. Organizations can apply standard or \nexisting risk controls and processes to proprietary or open-source GAI technologies, data, and third-party \nservice providers, including acquisition and procurement due diligence, requests for software bills of \nmaterials (SBOMs), application of service level agreements (SLAs), and statement on standards for \nattestation engagement (SSAE) reports to help with third-party transparency and risk management for \nGAI systems. \nA.1.4. Pre-Deployment Testing \nOverview \nThe diverse ways and contexts in which GAI systems may be developed, used, and repurposed \ncomplicates risk mapping and pre-deployment measurement efforts. Robust test, evaluation, validation, \nand verification (TEVV) processes can be iteratively applied – and documented – in early stages of the AI \nlifecycle and informed by representative AI Actors (see Figure 3 of the AI RMF). Until new and rigorous',
9 '8 \nTrustworthy AI Characteristics: Accountable and Transparent, Privacy Enhanced, Safe, Secure and \nResilient \n2.5. Environmental Impacts \nTraining, maintaining, and operating (running inference on) GAI systems are resource-intensive activities, \nwith potentially large energy and environmental footprints. Energy and carbon emissions vary based on \nwhat is being done with the GAI model (i.e., pre-training, fine-tuning, inference), the modality of the \ncontent, hardware used, and type of task or application. \nCurrent estimates suggest that training a single transformer LLM can emit as much carbon as 300 round-\ntrip flights between San Francisco and New York. In a study comparing energy consumption and carbon \nemissions for LLM inference, generative tasks (e.g., text summarization) were found to be more energy- \nand carbon-intensive than discriminative or non-generative tasks (e.g., text classification). \nMethods for creating smaller versions of trained models, such as model distillation or compression, \ncould reduce environmental impacts at inference time, but training and tuning such models may still \ncontribute to their environmental impacts. Currently there is no agreed upon method to estimate \nenvironmental impacts from GAI. \nTrustworthy AI Characteristics: Accountable and Transparent, Safe \n2.6. Harmful Bias and Homogenization \nBias exists in many forms and can become ingrained in automated systems. AI systems, including GAI \nsystems, can increase the speed and scale at which harmful biases manifest and are acted upon, \npotentially perpetuating and amplifying harms to individuals, groups, communities, organizations, and \nsociety. For example, when prompted to generate images of CEOs, doctors, lawyers, and judges, current \ntext-to-image models underrepresent women and/or racial minorities, and people with disabilities. \nImage generator models have also produced biased or stereotyped output for various demographic \ngroups and have difficulty producing non-stereotyped content even when the prompt specifically \nrequests image features that are inconsistent with the stereotypes. Harmful bias in GAI models, which \nmay stem from their training data, can also cause representational harms or perpetuate or exacerbate \nbias based on race, gender, disability, or other protected classes. \nHarmful bias in GAI systems can also lead to harms via disparities between how a model performs for \ndifferent subgroups or languages (e.g., an LLM may perform less well for non-English languages or \ncertain dialects). Such disparities can contribute to discriminatory decision-making or amplification of \nexisting societal biases. In addition, GAI systems may be inappropriately trusted to perform similarly \nacross all subgroups, which could leave the groups facing underperformance with worse outcomes than \nif no GAI system were used. Disparate or reduced performance for lower-resource languages also \npresents challenges to model adoption, inclusion, and accessibility, and may make preservation of \nendangered languages more difficult if GAI systems become embedded in everyday processes that would \notherwise have been opportunities to use these languages. \nBias is mutually reinforcing with the problem of undesired homogenization, in which GAI systems \nproduce skewed distributions of outputs that are overly uniform (for example, repetitive aesthetic styles',
10]
11embeddings = model.encode(sentences)
12print(embeddings.shape)
13# [3, 384]
14
15# Get the similarity scores for the embeddings
16similarities = model.similarity(embeddings, embeddings)
17print(similarities.shape)
18# [3, 3]sentence_0 and sentence_1| sentence_0 | sentence_1 | |
|---|---|---|
| type | string | string |
| details |
|
|
| sentence_0 | sentence_1 |
|---|---|
What measures are suggested to assess the environmental impact of AI model training and management activities? | 37 [object Object]MS-2.11-005 [object Object]Assess the proportion of synthetic to non-synthetic training data and verify [object Object]training data is not overly homogenous or GAI-produced to mitigate concerns of [object Object]model collapse. [object Object]Harmful Bias and Homogenization [object Object]AI Actor Tasks: AI Deployment, AI Impact Assessment, Affected Individuals and Communities, Domain Experts, End-Users, [object Object]Operation and Monitoring, TEVV [object Object] [object Object]MEASURE 2.12: Environmental impact and sustainability of AI model training and management activities – as identified in the MAP [object Object]function – are assessed and documented. [object Object]Action ID [object Object]Suggested Action [object Object]GAI Risks [object Object]MS-2.12-001 Assess safety to physical environments when deploying GAI systems. [object Object]Dangerous, Violent, or Hateful [object Object]Content [object Object]MS-2.12-002 Document anticipated environmental impacts of model development, [object Object]maintenance, and deployment in product design decisions. [object Object]Environmental [object Object]MS-2.12-003 [object Object]Measure or estimate environmental impacts (e.g., energy and water [object Object]consumption) for training, fine tuning, and deploying models: Verify tradeoffs [object Object]between resources used at inference time versus additional resources required [object Object]at training time. [object Object]Environmental [object Object]MS-2.12-004 Verify effectiveness of carbon capture or offset programs for GAI training and [object Object]applications, and address green-washing concerns. [object Object]Environmental [object Object]AI Actor Tasks: AI Deployment, AI Impact Assessment, Domain Experts, Operation and Monitoring, TEVV |
What are some limitations of current pre-deployment testing approaches for GAI applications? | 49 [object Object]early lifecycle TEVV approaches are developed and matured for GAI, organizations may use [object Object]recommended “pre-deployment testing” practices to measure performance, capabilities, limits, risks, [object Object]and impacts. This section describes risk measurement and estimation as part of pre-deployment TEVV, [object Object]and examines the state of play for pre-deployment testing methodologies. [object Object]Limitations of Current Pre-deployment Test Approaches [object Object]Currently available pre-deployment TEVV processes used for GAI applications may be inadequate, non-[object Object]systematically applied, or fail to reflect or mismatched to deployment contexts. For example, the [object Object]anecdotal testing of GAI system capabilities through video games or standardized tests designed for [object Object]humans (e.g., intelligence tests, professional licensing exams) does not guarantee GAI system validity or [object Object]reliability in those domains. Similarly, jailbreaking or prompt engineering tests may not systematically [object Object]assess validity or reliability risks. [object Object]Measurement gaps can arise from mismatches between laboratory and real-world settings. Current [object Object]testing approaches often remain focused on laboratory conditions or restricted to benchmark test [object Object]datasets and in silico techniques that may not extrapolate well to—or directly assess GAI impacts in real-[object Object]world conditions. For example, current measurement gaps for GAI make it difficult to precisely estimate [object Object]its potential ecosystem-level or longitudinal risks and related political, social, and economic impacts. [object Object]Gaps between benchmarks and real-world use of GAI systems may likely be exacerbated due to prompt [object Object]sensitivity and broad heterogeneity of contexts of use. [object Object]A.1.5. Structured Public Feedback [object Object]Structured public feedback can be used to evaluate whether GAI systems are performing as intended [object Object]and to calibrate and verify traditional measurement methods. Examples of structured feedback include, [object Object]but are not limited to: [object Object]• [object Object]Participatory Engagement Methods: Methods used to solicit feedback from civil society groups, [object Object]affected communities, and users, including focus groups, small user studies, and surveys. [object Object]• [object Object]Field Testing: Methods used to determine how people interact with, consume, use, and make [object Object]sense of AI-generated information, and subsequent actions and effects, including UX, usability, [object Object]and other structured, randomized experiments. [object Object]• [object Object]AI Red-teaming: A structured testing exercise used to probe an AI system to find flaws and [object Object]vulnerabilities such as inaccurate, harmful, or discriminatory outputs, often in a controlled [object Object]environment and in collaboration with system developers. [object Object]Information gathered from structured public feedback can inform design, implementation, deployment [object Object]approval, maintenance, or decommissioning decisions. Results and insights gleaned from these exercises [object Object]can serve multiple purposes, including improving data quality and preprocessing, bolstering governance [object Object]decision making, and enhancing system documentation and debugging practices. When implementing [object Object]feedback activities, organizations should follow human subjects research requirements and best [object Object]practices such as informed consent and subject compensation. |
How can organizations adjust their governance regimes to effectively manage the unique risks associated with generative AI? | 47 [object Object]Appendix A. Primary GAI Considerations [object Object]The following primary considerations were derived as overarching themes from the GAI PWG [object Object]consultation process. These considerations (Governance, Pre-Deployment Testing, Content Provenance, [object Object]and Incident Disclosure) are relevant for voluntary use by any organization designing, developing, and [object Object]using GAI and also inform the Actions to Manage GAI risks. Information included about the primary [object Object]considerations is not exhaustive, but highlights the most relevant topics derived from the GAI PWG. [object Object]Acknowledgments: These considerations could not have been surfaced without the helpful analysis and [object Object]contributions from the community and NIST staff GAI PWG leads: George Awad, Luca Belli, Harold Booth, [object Object]Mat Heyman, Yooyoung Lee, Mark Pryzbocki, Reva Schwartz, Martin Stanley, and Kyra Yee. [object Object]A.1. Governance [object Object]A.1.1. Overview [object Object]Like any other technology system, governance principles and techniques can be used to manage risks [object Object]related to generative AI models, capabilities, and applications. Organizations may choose to apply their [object Object]existing risk tiering to GAI systems, or they may opt to revise or update AI system risk levels to address [object Object]these unique GAI risks. This section describes how organizational governance regimes may be re-[object Object]evaluated and adjusted for GAI contexts. It also addresses third-party considerations for governing across [object Object]the AI value chain. [object Object]A.1.2. Organizational Governance [object Object]GAI opportunities, risks and long-term performance characteristics are typically less well-understood [object Object]than non-generative AI tools and may be perceived and acted upon by humans in ways that vary greatly. [object Object]Accordingly, GAI may call for different levels of oversight from AI Actors or different human-AI [object Object]configurations in order to manage their risks effectively. Organizations’ use of GAI systems may also [object Object]warrant additional human review, tracking and documentation, and greater management oversight. [object Object]AI technology can produce varied outputs in multiple modalities and present many classes of user [object Object]interfaces. This leads to a broader set of AI Actors interacting with GAI systems for widely differing [object Object]applications and contexts of use. These can include data labeling and preparation, development of GAI [object Object]models, content moderation, code generation and review, text generation and editing, image and video [object Object]generation, summarization, search, and chat. These activities can take place within organizational [object Object]settings or in the public domain. [object Object]Organizations can restrict AI applications that cause harm, exceed stated risk tolerances, or that conflict [object Object]with their tolerances or values. Governance tools and protocols that are applied to other types of AI [object Object]systems can be applied to GAI systems. These plans and actions include: [object Object]• Accessibility and reasonable [object Object]accommodations [object Object]• AI actor credentials and qualifications [object Object]• Alignment to organizational values [object Object]• Auditing and assessment [object Object]• Change-management controls [object Object]• Commercial use [object Object]• Data provenance |
MultipleNegativesRankingLoss with these parameters:
1{
2 "scale": 20.0,
3 "similarity_fct": "cos_sim"
4}per_device_train_batch_size: 20per_device_eval_batch_size: 20num_train_epochs: 10multi_dataset_batch_sampler: round_robinoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: noprediction_loss_only: Trueper_device_train_batch_size: 20per_device_eval_batch_size: 20per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_accumulation_steps: 1eval_accumulation_steps: Nonetorch_empty_cache_steps: Nonelearning_rate: 5e-05weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1num_train_epochs: 10max_steps: -1lr_scheduler_type: linearlr_scheduler_kwargs: {}warmup_ratio: 0.0warmup_steps: 0log_level: passivelog_level_replica: warninglog_on_each_node: Truelogging_nan_inf_filter: Truesave_safetensors: Truesave_on_each_node: Falsesave_only_model: Falserestore_callback_states_from_checkpoint: Falseno_cuda: Falseuse_cpu: Falseuse_mps_device: Falseseed: 42data_seed: Nonejit_mode_eval: Falseuse_ipex: Falsebf16: Falsefp16: Falsefp16_opt_level: O1half_precision_backend: autobf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonelocal_rank: 0ddp_backend: Nonetpu_num_cores: Nonetpu_metrics_debug: Falsedebug: []dataloader_drop_last: Falsedataloader_num_workers: 0dataloader_prefetch_factor: Nonepast_index: -1disable_tqdm: Falseremove_unused_columns: Truelabel_names: Noneload_best_model_at_end: Falseignore_data_skip: Falsefsdp: []fsdp_min_num_params: 0fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}fsdp_transformer_layer_cls_to_wrap: Noneaccelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}deepspeed: Nonelabel_smoothing_factor: 0.0optim: adamw_torchoptim_args: Noneadafactor: Falsegroup_by_length: Falselength_column_name: lengthddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falsedataloader_pin_memory: Truedataloader_persistent_workers: Falseskip_memory_metrics: Trueuse_legacy_prediction_loop: Falsepush_to_hub: Falseresume_from_checkpoint: Nonehub_model_id: Nonehub_strategy: every_savehub_private_repo: Falsehub_always_push: Falsegradient_checkpointing: Falsegradient_checkpointing_kwargs: Noneinclude_inputs_for_metrics: Falseeval_do_concat_batches: Truefp16_backend: autopush_to_hub_model_id: Nonepush_to_hub_organization: Nonemp_parameters:auto_find_batch_size: Falsefull_determinism: Falsetorchdynamo: Noneray_scope: lastddp_timeout: 1800torch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Nonedispatch_batches: Nonesplit_batches: Noneinclude_tokens_per_second: Falseinclude_num_input_tokens_seen: Falseneftune_noise_alpha: Noneoptim_target_modules: Nonebatch_eval_metrics: Falseeval_on_start: Falseeval_use_gather_object: Falsebatch_sampler: batch_samplermulti_dataset_batch_sampler: round_robin1@inproceedings{reimers-2019-sentence-bert,
2 title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
3 author = "Reimers, Nils and Gurevych, Iryna",
4 booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
5 month = "11",
6 year = "2019",
7 publisher = "Association for Computational Linguistics",
8 url = "https://arxiv.org/abs/1908.10084",
9}1@misc{henderson2017efficient,
2 title={Efficient Natural Language Response Suggestion for Smart Reply},
3 author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
4 year={2017},
5 eprint={1705.00652},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL}
8}